mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-15 13:19:27 +02:00
compiler: don't search symbol in other symtables than in found nested class, fix wrong test + add another one
git-svn-id: trunk@21275 -
This commit is contained in:
parent
62b59235ca
commit
62a91ef626
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -10450,6 +10450,7 @@ tests/test/tclass12d.pp svneol=native#text/plain
|
||||
tests/test/tclass13.pp svneol=native#text/pascal
|
||||
tests/test/tclass13a.pp svneol=native#text/plain
|
||||
tests/test/tclass13b.pp svneol=native#text/plain
|
||||
tests/test/tclass13c.pp svneol=native#text/pascal
|
||||
tests/test/tclass14a.pp svneol=native#text/pascal
|
||||
tests/test/tclass14b.pp svneol=native#text/pascal
|
||||
tests/test/tclass15.pp svneol=native#text/pascal
|
||||
|
@ -195,6 +195,7 @@ implementation
|
||||
structstackindex: longint;
|
||||
srsym: tsym;
|
||||
srsymtable: tsymtable;
|
||||
oldsymtablestack: TSymtablestack;
|
||||
begin
|
||||
if assigned(currentstructstack) then
|
||||
structstackindex:=currentstructstack.count-1
|
||||
@ -218,10 +219,14 @@ implementation
|
||||
else
|
||||
begin
|
||||
structstackindex:=-1;
|
||||
oldsymtablestack:=symtablestack;
|
||||
symtablestack:=TSymtablestack.create;
|
||||
symtablestack.push(tabstractrecorddef(def).symtable);
|
||||
t2:=generrordef;
|
||||
id_type(t2,isforwarddef,false,false,srsym,srsymtable);
|
||||
symtablestack.pop(tabstractrecorddef(def).symtable);
|
||||
symtablestack.free;
|
||||
symtablestack:=oldsymtablestack;
|
||||
def:=t2;
|
||||
end;
|
||||
end
|
||||
|
@ -18,16 +18,16 @@ type
|
||||
FNode: TRootClass.TNode.TNode;
|
||||
end;
|
||||
en = (e1,e2);
|
||||
TOtherNode = class
|
||||
public
|
||||
type
|
||||
TNestedInOtherNode = class
|
||||
ffield: longint;
|
||||
TOtherNode = class
|
||||
public
|
||||
type
|
||||
TNestedInOtherNode = class
|
||||
ffield: longint;
|
||||
end;
|
||||
end;
|
||||
TFinalNode = class
|
||||
fx: TRootClass.TNode.TOtherNode.TNestedInOtherNode;
|
||||
end;
|
||||
end;
|
||||
TFinalNode = class
|
||||
fx: TRootClass.TOtherNode.TNestedInOtherNode;
|
||||
end;
|
||||
published
|
||||
property Test: Integer read FTest write FTest;
|
||||
end;
|
||||
|
12
tests/test/tclass13c.pp
Normal file
12
tests/test/tclass13c.pp
Normal file
@ -0,0 +1,12 @@
|
||||
{ %norun }
|
||||
{ %fail }
|
||||
|
||||
{$mode delphi}
|
||||
|
||||
type
|
||||
TRootClass = class
|
||||
Value: TRootClass.Integer;
|
||||
end;
|
||||
|
||||
begin
|
||||
end.
|
Loading…
Reference in New Issue
Block a user