diff --git a/CodeCompletion/SymTable.cs b/CodeCompletion/SymTable.cs index f45c09f83..41d725d80 100644 --- a/CodeCompletion/SymTable.cs +++ b/CodeCompletion/SymTable.cs @@ -4095,6 +4095,7 @@ namespace CodeCompletion public bool is_final; public bool aliased = false; internal bool lazy_instance = false; + private static Dictionary> instance_cache = new Dictionary>(); public TypeScope() { } public TypeScope(SymbolKind kind, SymScope topScope, SymScope baseScope) diff --git a/Compiler/PCU/PCUReader.cs b/Compiler/PCU/PCUReader.cs index 256e67c4e..3cedba245 100644 --- a/Compiler/PCU/PCUReader.cs +++ b/Compiler/PCU/PCUReader.cs @@ -67,6 +67,7 @@ namespace PascalABCCompiler.PCU private SortedDictionary interf_type_list = new SortedDictionary(); private SortedDictionary impl_type_list = new SortedDictionary(); private Dictionary waited_method_codes = new Dictionary(); + private bool waited_method_restoring = false; internal static Dictionary AllReadOrWritedDefinitionNodesOffsets = new Dictionary(); internal void AddMember(definition_node dn, int offset) { @@ -696,8 +697,10 @@ namespace PascalABCCompiler.PCU public void RestoreWaitedMethodCodes() { + waited_method_restoring = true; foreach (common_method_node cmn in waited_method_codes.Keys) cmn.function_code = GetCode(waited_method_codes[cmn]); + waited_method_restoring = false; } //получение кода метода @@ -1880,10 +1883,10 @@ namespace PascalABCCompiler.PCU type_node type = GetTypeReference(); common_method_node get_meth = null; if (br.ReadByte() == 1) - get_meth = GetClassMethod(br.ReadInt32(), true); + get_meth = GetClassMethod(br.ReadInt32(), !waited_method_restoring); common_method_node set_meth = null; if (br.ReadByte() == 1) - set_meth = GetClassMethod(br.ReadInt32(), true); + set_meth = GetClassMethod(br.ReadInt32(), !waited_method_restoring); int num = br.ReadInt32(); parameter_list pl = new parameter_list(); for (int i = 0; i < num; i++) diff --git a/TestSuite/units/u_records6.pas b/TestSuite/units/u_records6.pas new file mode 100644 index 000000000..bea5d2666 --- /dev/null +++ b/TestSuite/units/u_records6.pas @@ -0,0 +1,22 @@ +unit u_records6; + +type + // Обязательно запись - с классом не воспроизводится + t1 = record + + // Обязательно свойство + property p1: byte read 0; + + end; + + t2 = class + + // Обязательно свойство, использующее t1 + property p2: word write + begin + var o: t1; + end; + + end; + +end. \ No newline at end of file diff --git a/TestSuite/usesunits/use_records6.pas b/TestSuite/usesunits/use_records6.pas new file mode 100644 index 000000000..0f8fcc17f --- /dev/null +++ b/TestSuite/usesunits/use_records6.pas @@ -0,0 +1,4 @@ +uses u_records6; +begin + new t2; +end. \ No newline at end of file