bug fix #980
This commit is contained in:
parent
b0bd845ec0
commit
ac059b02c2
12
TestSuite/extensionmethods30.pas
Normal file
12
TestSuite/extensionmethods30.pas
Normal 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.
|
||||
|
|
@ -3309,7 +3309,7 @@ namespace PascalABCCompiler.TreeRealization
|
|||
sil = bas_type.scope.SymbolTable.Find(bas_type.scope, name);
|
||||
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++)
|
||||
{
|
||||
|
|
@ -3318,10 +3318,16 @@ namespace PascalABCCompiler.TreeRealization
|
|||
ctn = ctn.original_generic as compiled_type_node;
|
||||
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)
|
||||
sil.AddRange(sil3);
|
||||
else
|
||||
sil = sil3;
|
||||
}
|
||||
}
|
||||
if (sil != null)
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue