Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Внутренняя ошибка, при компиляции модуля из папки, если есть унаследованный конструктор с недоступным типом #1933

Closed
SunSerega opened this issue May 9, 2019 · 4 comments
Assignees

Comments

@SunSerega
Copy link
Contributor

u1.pas:

unit u1;

uses u2;

type
  t2 = class(t1)
    //обязательно унаследовать конструктор t1
  end;

end.

u2.pas:

unit u2;

uses u3;

type
  t1 = class
    
    // обязательно использовать t0 в типах параметров, которое невидимо из u1
    // можно, к примеру, "array of t0", тоже воспроизведётся
    constructor(a: t0) := exit;
    
  end;

end.

u3.pas:

unit u3;

type t0=class end;

end.

0.zip

При компиляции из IDE - не создаётся u1.pcu, а при компиляции из папки:

[0]Internal compiler error in module Compiler.Compile[u1.pas] :'System.Collections.Generic.KeyNotFoundException: Данный ключ отсутствует в словаре.
   в System.ThrowHelper.ThrowKeyNotFoundException()
   в System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   в PascalABCCompiler.PCU.PCUWriter.GetUnitToken(common_namespace_node ns)
   в PascalABCCompiler.PCU.PCUWriter.GetTypeReference(type_node tn, Byte& is_def)
   в PascalABCCompiler.PCU.PCUWriter.WriteTypeReference(type_node type)
   в PascalABCCompiler.PCU.PCUWriter.VisitParameter(common_parameter p)
   в PascalABCCompiler.PCU.PCUWriter.VisitMethodDefinition(common_method_node meth, Int32 offset)
   в PascalABCCompiler.PCU.PCUWriter.VisitMethodDefinitions(common_type_node ctn)
   в PascalABCCompiler.PCU.PCUWriter.VisitTypeMemberDefinition(common_type_node ctn)
   в PascalABCCompiler.PCU.PCUWriter.SaveSemanticTree(CompilationUnit Unit, String TargetFileName, Boolean IncludeDebugInfo)
   в PascalABCCompiler.Compiler.SavePCU(CompilationUnit Unit, String TagertFileName)'
@miks1965
Copy link
Contributor

miks1965 commented May 9, 2019

А что такое компиляция из папки?

@SunSerega
Copy link
Contributor Author

SunSerega commented May 9, 2019

В папке ПКМ по файлу и компилировать:

image

image

@miks1965
Copy link
Contributor

miks1965 commented May 9, 2019

Это проблемы записи в PCU

@ibond84
Copy link
Contributor

ibond84 commented Oct 13, 2019

Ошибка как всегда в семантике, которая передает неполный список подключенных модулей. К u1 неявно подключается модуль u3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants