This commit is contained in:
Ivan Bondarev 2023-05-14 11:36:08 +02:00
parent 9ffbea0c95
commit 9acb0d71a8
3 changed files with 26 additions and 0 deletions

View file

@ -0,0 +1,7 @@
unit u_abstract2;
type
t1<TSelf> = abstract class
where TSelf: t1<TSelf>;
end;
end.

View file

@ -0,0 +1,10 @@
uses u_abstract2;
type
t2 = abstract class(t1<t2>) end;
t3 = class(t2)
end;
begin
new t3;
end.

View file

@ -66,6 +66,7 @@ namespace PascalABCCompiler.TreeRealization
foreach (type_node t in generic_params)
{
generic_parameter_eliminations gpe = new generic_parameter_eliminations();
gpe.has_default_ctor = generic_convertions.type_has_default_ctor(t, false);
if (t is common_type_node && (t as common_type_node).has_explicit_default_constructor)
gpe.has_explicit_default_ctor = true;
@ -1791,6 +1792,14 @@ namespace PascalABCCompiler.TreeRealization
return cmn;
}
public override bool IsAbstract
{
get
{
return original_generic.IsAbstract;
}
}
public override List<type_node> instance_params
{
get