compiler: allow to derive classes from a nested class type (issue #0016083)

git-svn-id: trunk@15036 -
This commit is contained in:
paul 2010-03-23 05:36:11 +00:00
parent 8aaa5ee123
commit 1768810783
3 changed files with 25 additions and 2 deletions

1
.gitattributes vendored
View File

@ -10319,6 +10319,7 @@ tests/webtbs/tw15909.pp svneol=native#text/plain
tests/webtbs/tw1592.pp svneol=native#text/plain
tests/webtbs/tw15930.pp svneol=native#text/plain
tests/webtbs/tw16040.pp svneol=native#text/plain
tests/webtbs/tw16083.pp svneol=native#text/plain
tests/webtbs/tw1617.pp svneol=native#text/plain
tests/webtbs/tw1622.pp svneol=native#text/plain
tests/webtbs/tw1623.pp svneol=native#text/plain

View File

@ -458,7 +458,7 @@ implementation
else
begin
id_type(def,isforwarddef);
{ handle types inside classes for generics, e.g. TNode.TLongint }
{ handle types inside classes, e.g. TNode.TLongint }
while (token=_POINT) do
begin
if parse_generic then
@ -466,7 +466,7 @@ implementation
consume(_POINT);
consume(_ID);
end
else if ((def.typ=objectdef) and (df_specialization in def.defoptions)) then
else if is_class(def) then
begin
symtablestack.push(tobjectdef(def).symtable);
consume(_POINT);

22
tests/webtbs/tw16083.pp Normal file
View File

@ -0,0 +1,22 @@
{ %norun }
program tw16083;
{$ifdef fpc}
{$mode delphi}
{$endif}
type
TClass1 = class
public type
TNestedClass = class
end;
TNestedClass2 = class(TNestedClass)
end;
end;
TClass3 = class(TClass1.TNestedClass)
end;
begin
end.