This commit is contained in:
parent
cbc8a681d9
commit
e402243f2d
15
TestSuite/implicitexplicit8.pas
Normal file
15
TestSuite/implicitexplicit8.pas
Normal 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.
|
||||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue