compiler: allow "with" to search members in nested types properly

git-svn-id: trunk@18987 -
This commit is contained in:
paul 2011-09-06 10:23:57 +00:00
parent 3cc6ac9e3b
commit 7dd8a97487
4 changed files with 29 additions and 2 deletions

1
.gitattributes vendored
View File

@ -9904,6 +9904,7 @@ tests/test/tclass13a.pp svneol=native#text/plain
tests/test/tclass13b.pp svneol=native#text/plain
tests/test/tclass14a.pp svneol=native#text/pascal
tests/test/tclass14b.pp svneol=native#text/pascal
tests/test/tclass15.pp svneol=native#text/pascal
tests/test/tclass2.pp svneol=native#text/plain
tests/test/tclass3.pp svneol=native#text/plain
tests/test/tclass4.pp svneol=native#text/plain

View File

@ -2047,7 +2047,7 @@ implementation
((FProcSymtable.symtabletype=withsymtable) and
(FProcSymtable.defowner.typ in [objectdef,recorddef]))
) and
(FProcSymtable.defowner.owner.symtabletype in [globalsymtable,staticsymtable]) and
(FProcSymtable.defowner.owner.symtabletype in [globalsymtable,staticsymtable,objectsymtable,recordsymtable]) and
FProcSymtable.defowner.owner.iscurrentunit then
contextstructdef:=tabstractrecorddef(FProcSymtable.defowner)
else

View File

@ -1994,7 +1994,7 @@ implementation
if (srsymtable.symtabletype=withsymtable) and
assigned(srsymtable.defowner) and
(srsymtable.defowner.typ in [recorddef,objectdef]) and
(srsymtable.defowner.owner.symtabletype in [globalsymtable,staticsymtable]) and
(srsymtable.defowner.owner.symtabletype in [globalsymtable,staticsymtable,objectsymtable,recordsymtable]) and
(srsymtable.defowner.owner.iscurrentunit) then
contextstructdef:=tabstractrecorddef(srsymtable.defowner)
else

26
tests/test/tclass15.pp Normal file
View File

@ -0,0 +1,26 @@
{ %norun }
program tclass15;
{$MODE DELPHI}
uses
Classes;
type
TMyClass=class
private
type
TMyMemoryStream=class(TCustomMemoryStream) end;
public
procedure MyProc;
end;
procedure TMyClass.MyProc;
begin
with TMyMemoryStream.Create do
SetPointer(nil,0)
end;
begin
end.