mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 19:49:22 +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/tclass13.pp svneol=native#text/pascal
|
||||||
tests/test/tclass13a.pp svneol=native#text/plain
|
tests/test/tclass13a.pp svneol=native#text/plain
|
||||||
tests/test/tclass13b.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/tclass14a.pp svneol=native#text/pascal
|
||||||
tests/test/tclass14b.pp svneol=native#text/pascal
|
tests/test/tclass14b.pp svneol=native#text/pascal
|
||||||
tests/test/tclass15.pp svneol=native#text/pascal
|
tests/test/tclass15.pp svneol=native#text/pascal
|
||||||
|
@ -195,6 +195,7 @@ implementation
|
|||||||
structstackindex: longint;
|
structstackindex: longint;
|
||||||
srsym: tsym;
|
srsym: tsym;
|
||||||
srsymtable: tsymtable;
|
srsymtable: tsymtable;
|
||||||
|
oldsymtablestack: TSymtablestack;
|
||||||
begin
|
begin
|
||||||
if assigned(currentstructstack) then
|
if assigned(currentstructstack) then
|
||||||
structstackindex:=currentstructstack.count-1
|
structstackindex:=currentstructstack.count-1
|
||||||
@ -218,10 +219,14 @@ implementation
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
structstackindex:=-1;
|
structstackindex:=-1;
|
||||||
|
oldsymtablestack:=symtablestack;
|
||||||
|
symtablestack:=TSymtablestack.create;
|
||||||
symtablestack.push(tabstractrecorddef(def).symtable);
|
symtablestack.push(tabstractrecorddef(def).symtable);
|
||||||
t2:=generrordef;
|
t2:=generrordef;
|
||||||
id_type(t2,isforwarddef,false,false,srsym,srsymtable);
|
id_type(t2,isforwarddef,false,false,srsym,srsymtable);
|
||||||
symtablestack.pop(tabstractrecorddef(def).symtable);
|
symtablestack.pop(tabstractrecorddef(def).symtable);
|
||||||
|
symtablestack.free;
|
||||||
|
symtablestack:=oldsymtablestack;
|
||||||
def:=t2;
|
def:=t2;
|
||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
|
@ -18,16 +18,16 @@ type
|
|||||||
FNode: TRootClass.TNode.TNode;
|
FNode: TRootClass.TNode.TNode;
|
||||||
end;
|
end;
|
||||||
en = (e1,e2);
|
en = (e1,e2);
|
||||||
TOtherNode = class
|
TOtherNode = class
|
||||||
public
|
public
|
||||||
type
|
type
|
||||||
TNestedInOtherNode = class
|
TNestedInOtherNode = class
|
||||||
ffield: longint;
|
ffield: longint;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
TFinalNode = class
|
||||||
|
fx: TRootClass.TNode.TOtherNode.TNestedInOtherNode;
|
||||||
end;
|
end;
|
||||||
end;
|
|
||||||
TFinalNode = class
|
|
||||||
fx: TRootClass.TOtherNode.TNestedInOtherNode;
|
|
||||||
end;
|
|
||||||
published
|
published
|
||||||
property Test: Integer read FTest write FTest;
|
property Test: Integer read FTest write FTest;
|
||||||
end;
|
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