This commit is contained in:
Бондарев Иван 2018-10-03 21:21:24 +02:00
parent 45352cc287
commit 37733573a5
2 changed files with 15 additions and 0 deletions

13
TestSuite/generics24.pas Normal file
View file

@ -0,0 +1,13 @@
type
at1 = abstract class
public constructor := exit;
end;
procedure p1<T1>(o1: T1);
where T1: at1;
begin end;
begin
var o: at1;
p1(o);
end.

View file

@ -1334,6 +1334,8 @@ namespace PascalABCCompiler.TreeRealization
public static bool type_has_default_ctor(type_node tn, bool find_protected_ctors)
{
if (tn.is_generic_parameter && tn.base_type != null && tn.base_type.IsAbstract)
return false;
List<SymbolInfo> sil = tn.find_in_type(compiler_string_consts.default_constructor_name, tn.Scope);
if (sil != null)
{