fix #786
This commit is contained in:
parent
e4abab739c
commit
6191c3333f
10
TestSuite/constructor1.pas
Normal file
10
TestSuite/constructor1.pas
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
type
|
||||
MyException=class(Exception)
|
||||
constructor :=
|
||||
create('Some text');
|
||||
end;
|
||||
|
||||
begin
|
||||
var ex := new MyException;
|
||||
assert(ex.Message = 'Some text');
|
||||
end.
|
||||
|
|
@ -4962,6 +4962,12 @@ namespace PascalABCCompiler.TreeConverter
|
|||
{
|
||||
sil = context.converted_namespace.find(id.name);
|
||||
}
|
||||
if (sil != null && id.name.ToLower() == "create" && context.converted_type != null && sil.FirstOrDefault().sym_info is common_method_node && (sil.FirstOrDefault().sym_info as common_method_node).is_constructor)
|
||||
{
|
||||
List<SymbolInfo> base_si_list = context.converted_type.base_type.find(id.name);
|
||||
if (base_si_list != null)
|
||||
sil.AddRange(base_si_list);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue