This commit is contained in:
Ivan Bondarev 2022-12-18 13:55:26 +01:00
parent 2faf78f84a
commit 80f8e26011
3 changed files with 3 additions and 3 deletions

View file

@ -1,4 +1,4 @@
//!Нельзя преобразовать тип integer к Func<integer>
//!Нельзя преобразовать тип Func<integer> к integer
procedure p1<T>(a: array of ()->T; v: T) :=
a[0] := ()->v;
begin

View file

@ -1,4 +1,4 @@
//!Нельзя преобразовать тип integer к Func<integer>
//!Нельзя преобразовать тип Func<integer> к integer
procedure p1<T>(a: array of ()->T; v: T) :=
a[0] := ()->v;
begin

View file

@ -184,7 +184,7 @@ namespace PascalABCCompiler.TreeConverter
convertion_data_and_alghoritms.check_convert_type_with_inheritance(elem_type, foreachVariable.type,
get_location(_foreach_stmt.identifier));
if (elem_type.IsDelegate && !foreachVariable.type.IsDelegate)
AddError(new CanNotConvertTypes(null, foreachVariable.type, elem_type, get_location(_foreach_stmt.identifier)));
AddError(new CanNotConvertTypes(null, elem_type, foreachVariable.type, get_location(_foreach_stmt.identifier)));
return foreachVariable;
}