pascalabcnet / pascalabcnet

The new generation Pascal programming language for .NET

Home Page:http://pascalabc.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`PCUWriter` падает, когда встречает тип из неявно подключённого модуля

SunSerega opened this issue · comments

Та же проблема что в #2868, но с ещё одним типом узлов.

0.zip

unit u1;

uses u2;

procedure p1<T>(o: t1<T>) := exit;

begin
  // Любой из этих двух вызовов крашит PCUWriter
  p1(new t2);
  p1(new t3);
end.
unit u2;

uses u3;

type
  t1<T> = class end;
  t2 = class(t1<t_err>) end;
  t3 = t1<t_err>;
  
end.
unit u3;

type
  t_err = class end;
  
end.
[0]Internal compiler error in module Compiler.Compile[u1.pas] :'System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.ThrowHelper.ThrowKeyNotFoundException()
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at PascalABCCompiler.PCU.PCUWriter.GetTypeReference(type_node tn, Byte& is_def)
   at PascalABCCompiler.PCU.PCUWriter.WriteTypeReference(type_node type)
   at PascalABCCompiler.PCU.PCUWriter.WriteTypeList(List`1 types)
   at PascalABCCompiler.PCU.PCUWriter.WriteFunctionReference(common_namespace_function_node fn)
   at PascalABCCompiler.PCU.PCUWriter.VisitCommonNamespaceFunctionCall(common_namespace_function_call expr)
   at PascalABCCompiler.PCU.PCUWriter.VisitStatement(statement_node sn)
   at PascalABCCompiler.PCU.PCUWriter.VisitStatementList(statements_list stmt)
   at PascalABCCompiler.PCU.PCUWriter.VisitStatement(statement_node sn)
   at PascalABCCompiler.PCU.PCUWriter.SaveSemanticTree(CompilationUnit Unit, String TargetFileName, Boolean IncludeDebugInfo)
   at PascalABCCompiler.Compiler.SavePCU(CompilationUnit Unit)'