fix #1265
This commit is contained in:
parent
45352cc287
commit
37733573a5
13
TestSuite/generics24.pas
Normal file
13
TestSuite/generics24.pas
Normal 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.
|
||||||
|
|
@ -1334,6 +1334,8 @@ namespace PascalABCCompiler.TreeRealization
|
||||||
|
|
||||||
public static bool type_has_default_ctor(type_node tn, bool find_protected_ctors)
|
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);
|
List<SymbolInfo> sil = tn.find_in_type(compiler_string_consts.default_constructor_name, tn.Scope);
|
||||||
if (sil != null)
|
if (sil != null)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue