bug fix #485
This commit is contained in:
parent
199e9f42e3
commit
07d35c674a
|
|
@ -443,7 +443,8 @@ namespace CodeCompletion
|
|||
|
||||
public void AddUsedUnit(SymScope unit)
|
||||
{
|
||||
used_units.Add(unit);
|
||||
if (!hasUsesCycle(unit))
|
||||
used_units.Add(unit);
|
||||
}
|
||||
|
||||
public virtual string GetFullName()
|
||||
|
|
|
|||
13
TestSuite/extensionmethods22.pas
Normal file
13
TestSuite/extensionmethods22.pas
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
type BallInfo = class
|
||||
x: integer;
|
||||
end;
|
||||
|
||||
begin
|
||||
var a : array of BallInfo;
|
||||
a := new BallInfo[2](new BallInfo, new BallInfo);
|
||||
var s := 0;
|
||||
a[0].x := 1;
|
||||
a[1].x := 2;
|
||||
a.ForEach(x->begin s += x.x end);
|
||||
assert(s = 3);
|
||||
end.
|
||||
|
|
@ -1963,15 +1963,20 @@ namespace PascalABCCompiler.TreeRealization
|
|||
{
|
||||
return base_generic_instance.ConvertSymbolInfo(si);
|
||||
}
|
||||
else if (si == null)
|
||||
else //if (si == null)
|
||||
{
|
||||
if (ImplementingInterfaces != null)
|
||||
{
|
||||
foreach (type_node ii_tn in ImplementingInterfaces)
|
||||
{
|
||||
si = ii_tn.find_in_type(name, CurrentScope);
|
||||
if (si != null)
|
||||
return si;
|
||||
SymbolInfoList isi = ii_tn.find_in_type(name, CurrentScope);
|
||||
if (isi != null)
|
||||
{
|
||||
if (si == null)
|
||||
si = isi;
|
||||
else
|
||||
si.Add(isi);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue