This commit is contained in:
Ivan Bondarev 2021-01-07 20:31:51 +01:00
parent cbc8a681d9
commit e402243f2d
2 changed files with 19 additions and 1 deletions

View file

@ -0,0 +1,15 @@
var o: System.Type;
type
t1 = class
static function operator implicit<T>(val: T): t1;
begin
o := typeof(T);
end;
end;
t2<T> = class end;
begin
var a: t1 := new t2<integer>;
assert(o = typeof(t2<integer>));
end.

View file

@ -2362,7 +2362,10 @@ namespace PascalABCCompiler.TreeRealization
}
else if (ctn.instance_params != null && ctn.instance_params.Count > 0)
{
fn = fn.get_instance(ctn.instance_params, true, null);
if (fn.parameters[0].type.is_generic_parameter)
fn = fn.get_instance(new List<type_node>() { ctn }, true, null);
else
fn = fn.get_instance(ctn.instance_params, true, null);
}
else if (fn.get_generic_params_list() != null && fn.get_generic_params_list().Count > 0)
{