This commit is contained in:
Бондарев Иван 2018-08-08 14:35:49 +02:00
parent b0bd845ec0
commit ac059b02c2
2 changed files with 22 additions and 4 deletions

View file

@ -0,0 +1,12 @@
begin
var d:=new Dictionary<byte,integer>;
d.Add(1, 2);
var s:sequence of integer := d.Values + 5;
var s2: sequence of byte := d.Keys + byte(5);
var a := s.ToArray();
assert(a[0] = 2);
assert(a[1] = 5);
var a2 := s2.ToArray();
assert(a2[0] = 1);
assert(a2[1] = 5);
end.

View file

@ -3309,7 +3309,7 @@ namespace PascalABCCompiler.TreeRealization
sil = bas_type.scope.SymbolTable.Find(bas_type.scope, name); sil = bas_type.scope.SymbolTable.Find(bas_type.scope, name);
bas_type = bas_type.base_type as compiled_type_node; bas_type = bas_type.base_type as compiled_type_node;
} }
if (sil == null) //if (sil == null || true)
{ {
for (int i = 0; i < ImplementingInterfaces.Count; i++) for (int i = 0; i < ImplementingInterfaces.Count; i++)
{ {
@ -3318,10 +3318,16 @@ namespace PascalABCCompiler.TreeRealization
ctn = ctn.original_generic as compiled_type_node; ctn = ctn.original_generic as compiled_type_node;
if (ctn != null && ctn.scope != null) if (ctn != null && ctn.scope != null)
{ {
sil = ctn.scope.SymbolTable.Find(ctn.scope, name); List<SymbolInfo> sil3 = ctn.scope.SymbolTable.Find(ctn.scope, name);
} if (sil3 != null)
{
if (sil != null) if (sil != null)
break; sil.AddRange(sil3);
else
sil = sil3;
}
}
} }
} }