This commit is contained in:
parent
98ecc8a608
commit
031f868124
13
TestSuite/foreach14.pas
Normal file
13
TestSuite/foreach14.pas
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
type c1 = class end;
|
||||
|
||||
var i := 0;
|
||||
begin
|
||||
|
||||
var d := new Dictionary<c1, Action0>;
|
||||
d.Add(new c1, ()->begin i := 1 end);
|
||||
|
||||
foreach var v in d.Values do
|
||||
//Ошибка: Невозможно явно преобразовать тип c1 к типу System.Action
|
||||
Action0(v).Invoke();
|
||||
assert(i = 1);
|
||||
end.
|
||||
|
|
@ -18469,7 +18469,11 @@ namespace PascalABCCompiler.TreeConverter
|
|||
break;
|
||||
}
|
||||
}
|
||||
if (elem_type == null)
|
||||
if (ct.Name == "ValueCollection" && ct.IsNested && ct.GetGenericArguments().Length == 2)
|
||||
{
|
||||
elem_type = ip[1];
|
||||
}
|
||||
else if (elem_type == null)
|
||||
elem_type = ip[0];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue