fix #2066
This commit is contained in:
parent
6fe9c73545
commit
85f95b0d05
11
TestSuite/namespaces/nspartial1.pas
Normal file
11
TestSuite/namespaces/nspartial1.pas
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
namespace nspartial;
|
||||
|
||||
type
|
||||
T = partial class
|
||||
public procedure Test1;
|
||||
begin
|
||||
Inc(i);
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
12
TestSuite/namespaces/nspartial2.pas
Normal file
12
TestSuite/namespaces/nspartial2.pas
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
namespace nspartial;
|
||||
|
||||
type
|
||||
T = partial class
|
||||
public i: integer;
|
||||
public procedure Test2;
|
||||
begin
|
||||
Inc(i);
|
||||
end;
|
||||
end;
|
||||
|
||||
end.
|
||||
11
TestSuite/use_ns_partial.pas
Normal file
11
TestSuite/use_ns_partial.pas
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
//nopabcrtl
|
||||
{$includenamespace 'namespaces/nspartial1.pas'}
|
||||
{$includenamespace 'namespaces/nspartial2.pas'}
|
||||
|
||||
uses nspartial;
|
||||
begin
|
||||
var o := new T;
|
||||
o.Test1;
|
||||
o.Test2;
|
||||
assert(o.i = 2);
|
||||
end.
|
||||
|
|
@ -10968,9 +10968,9 @@ namespace PascalABCCompiler.TreeConverter
|
|||
AddError(get_location(cl_def), "TYPE_PREDEFINITION_NOT_ALLOWED");
|
||||
common_type_node ctn = null;
|
||||
if (td.type_name is template_type_name)
|
||||
ctn = context.advanced_create_type(td.type_name.name + "`" + (td.type_name as template_type_name).template_args.Count, get_location(td.type_name), (td.type_def as class_definition).keyword == class_keyword.Interface, false);
|
||||
ctn = context.advanced_create_type(td.type_name.name + "`" + (td.type_name as template_type_name).template_args.Count, get_location(td.type_name), (td.type_def as class_definition).keyword == class_keyword.Interface, (cl_def.attribute & SyntaxTree.class_attribute.Partial) == SyntaxTree.class_attribute.Partial);
|
||||
else
|
||||
ctn = context.advanced_create_type(td.type_name.name, get_location(td.type_name), (td.type_def as class_definition).keyword == class_keyword.Interface, false);
|
||||
ctn = context.advanced_create_type(td.type_name.name, get_location(td.type_name), (td.type_def as class_definition).keyword == class_keyword.Interface, (cl_def.attribute & SyntaxTree.class_attribute.Partial) == SyntaxTree.class_attribute.Partial);
|
||||
ctn.ForwardDeclarationOnly = true;
|
||||
if ((td.type_def as class_definition).keyword == class_keyword.Interface)
|
||||
ctn.IsInterface = true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue