This commit is contained in:
parent
9a05812c1e
commit
8559cdf019
|
|
@ -903,6 +903,7 @@ namespace PascalABCCompiler.PCU
|
|||
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.UnitsTopologicallySortedList.Find(u => u.SemanticTree == comp_cnn.cont_unit));
|
||||
|
|
@ -916,6 +917,11 @@ namespace PascalABCCompiler.PCU
|
|||
}
|
||||
if (tn.base_type is common_type_node)
|
||||
AddIndirectUsedUnitsForType(tn.base_type, ns_dict, interf);
|
||||
if (tn is common_generic_instance_type_node)
|
||||
{
|
||||
foreach (type_node param_tn in (tn as common_generic_instance_type_node).instance_params)
|
||||
AddIndirectUsedUnitsForType(param_tn, ns_dict, interf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
10
TestSuite/units/u_indirect1.pas
Normal file
10
TestSuite/units/u_indirect1.pas
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
unit u_indirect1;
|
||||
|
||||
uses u_indirect2;
|
||||
|
||||
procedure p1<T>(o: t1<T>) := exit;
|
||||
|
||||
begin
|
||||
p1(new t2);
|
||||
p1(new t3);
|
||||
end.
|
||||
10
TestSuite/units/u_indirect2.pas
Normal file
10
TestSuite/units/u_indirect2.pas
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
unit u_indirect2;
|
||||
|
||||
uses u_indirect3;
|
||||
|
||||
type
|
||||
t1<T> = class end;
|
||||
t2 = class(t1<t_err>) end;
|
||||
t3 = t1<t_err>;
|
||||
|
||||
end.
|
||||
6
TestSuite/units/u_indirect3.pas
Normal file
6
TestSuite/units/u_indirect3.pas
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
unit u_indirect3;
|
||||
|
||||
type
|
||||
t_err = class end;
|
||||
|
||||
end.
|
||||
4
TestSuite/usesunits/use_indirect1.pas
Normal file
4
TestSuite/usesunits/use_indirect1.pas
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
uses u_indirect1;
|
||||
begin
|
||||
|
||||
end.
|
||||
Loading…
Reference in a new issue