This commit is contained in:
parent
a80c5218a1
commit
0d19f9073f
|
|
@ -877,6 +877,8 @@ namespace PascalABCCompiler.PCU
|
|||
if (tn is common_type_node)
|
||||
{
|
||||
common_namespace_node comp_cnn = (tn as common_type_node).comprehensive_namespace;
|
||||
if (tn is common_generic_instance_type_node)
|
||||
comp_cnn = (tn as common_generic_instance_type_node).common_original_generic.comprehensive_namespace;
|
||||
if (comp_cnn != null && !ns_dict.ContainsKey(comp_cnn) && unit.SemanticTree != comp_cnn.cont_unit)
|
||||
{
|
||||
var path = Compiler.GetUnitPath(unit, compiler.UnitsSortedList.Find(u => u.SemanticTree == comp_cnn.cont_unit));
|
||||
|
|
@ -912,6 +914,11 @@ namespace PascalABCCompiler.PCU
|
|||
common_static_method_call csmc = stmt as common_static_method_call;
|
||||
AddIndirectUsedUnitsForType(csmc.common_type, ns_dict, interf);
|
||||
}
|
||||
else if (stmt is common_method_call)
|
||||
{
|
||||
common_method_call cmc = stmt as common_method_call;
|
||||
AddIndirectUsedUnitsForType(cmc.function_node.cont_type, ns_dict, interf);
|
||||
}
|
||||
else if (stmt is if_node)
|
||||
{
|
||||
if_node node = stmt as if_node;
|
||||
|
|
|
|||
20
TestSuite/units/u_methodcall1.pas
Normal file
20
TestSuite/units/u_methodcall1.pas
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
unit u_methodcall1;
|
||||
|
||||
uses u_methodcall2;
|
||||
|
||||
var
|
||||
i: integer;
|
||||
|
||||
procedure p1;
|
||||
begin
|
||||
var a: t2 := new t2;
|
||||
var p := procedure->
|
||||
begin
|
||||
a.p1;
|
||||
Inc(i);
|
||||
end;
|
||||
p;
|
||||
end;
|
||||
|
||||
begin
|
||||
end.
|
||||
8
TestSuite/units/u_methodcall2.pas
Normal file
8
TestSuite/units/u_methodcall2.pas
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
unit u_methodcall2;
|
||||
|
||||
uses u_methodcall3;
|
||||
|
||||
type
|
||||
t2 = class(t1<object>) end;
|
||||
|
||||
end.
|
||||
10
TestSuite/units/u_methodcall3.pas
Normal file
10
TestSuite/units/u_methodcall3.pas
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
unit u_methodcall3;
|
||||
|
||||
type
|
||||
t1<T> = class
|
||||
|
||||
procedure p1 := exit;
|
||||
|
||||
end;
|
||||
|
||||
end.
|
||||
5
TestSuite/usesunits/use_methodcall1.pas
Normal file
5
TestSuite/usesunits/use_methodcall1.pas
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
uses u_methodcall1;
|
||||
begin
|
||||
p1;
|
||||
assert(i = 1);
|
||||
end.
|
||||
Loading…
Reference in a new issue