diff --git a/Compiler/PCU/PCUReader.cs b/Compiler/PCU/PCUReader.cs index 35d9de921..8576860e9 100644 --- a/Compiler/PCU/PCUReader.cs +++ b/Compiler/PCU/PCUReader.cs @@ -744,6 +744,8 @@ namespace PascalABCCompiler.PCU for (int i = 0; i < template_types.Length; i++) { Type tt = FindTypeByHandle(pcu_file.dotnet_names[off].addit[i].offset); + if (tt != null && pcu_file.dotnet_names[pcu_file.dotnet_names[off].addit[i].offset].name.IndexOf(".") == -1) + tt = null;//generic parameter if (tt == null) { tt = t.GetGenericArguments()[i]; diff --git a/TestSuite/CompilationSamples/lib1.dll b/TestSuite/CompilationSamples/lib1.dll new file mode 100644 index 000000000..34cac4d91 Binary files /dev/null and b/TestSuite/CompilationSamples/lib1.dll differ diff --git a/TestSuite/CompilationSamples/use_lib1.pas b/TestSuite/CompilationSamples/use_lib1.pas new file mode 100644 index 000000000..576d25a66 --- /dev/null +++ b/TestSuite/CompilationSamples/use_lib1.pas @@ -0,0 +1,8 @@ +{$reference 'lib1.dll'} + +procedure x := exit; + +begin + T.p(x); + assert(T.i = 1); +end. \ No newline at end of file diff --git a/TestSuite/lib1.dll b/TestSuite/lib1.dll new file mode 100644 index 000000000..34cac4d91 Binary files /dev/null and b/TestSuite/lib1.dll differ