This commit is contained in:
Mikhalkovich Stanislav 2020-06-18 00:27:04 +03:00
parent 9c9079868f
commit de4b9fd6a4
2 changed files with 9 additions and 1 deletions

6
TestSuite/dValues.pas Normal file
View file

@ -0,0 +1,6 @@
// #2256
begin
var d := new Dictionary<byte, word>;
d.Values.GetEnumerator();
Assert(1=1);
end.

View file

@ -661,7 +661,9 @@ namespace PascalABCCompiler.TreeConverter
return convert_type(en, (to as delegated_methods).empty_param_method.ret_type, loc);
}
en.location = loc;
AddError(new CanNotConvertTypes(en, en.type, to, loc));
if (en.type is delegated_methods dm && dm.proper_methods[0].parameters.Count == 0 && dm.proper_methods[0].ret_type != null)
AddError(new CanNotConvertTypes(en, dm.proper_methods[0].ret_type, to, loc)); // SSM 18/06/20 #2261
else AddError(new CanNotConvertTypes(en, en.type, to, loc));
}
#if (DEBUG)