compiler: allow class declarations inside records (1 part of issue #0019099)

git-svn-id: trunk@17335 -
This commit is contained in:
paul 2011-04-18 03:26:46 +00:00
parent 56cd7b3450
commit 550ad700c3
3 changed files with 30 additions and 1 deletions

1
.gitattributes vendored
View File

@ -9695,6 +9695,7 @@ tests/test/tenum6.pp svneol=native#text/pascal
tests/test/tenumerators1.pp svneol=native#text/pascal
tests/test/terecs1.pp svneol=native#text/pascal
tests/test/terecs10.pp svneol=native#text/pascal
tests/test/terecs11.pp svneol=native#text/pascal
tests/test/terecs2.pp svneol=native#text/pascal
tests/test/terecs3.pp svneol=native#text/pascal
tests/test/terecs4.pp svneol=native#text/pascal

View File

@ -1082,7 +1082,7 @@ implementation
current_specializedef:=nil;
{ objects and class types can't be declared local }
if not(symtablestack.top.symtabletype in [globalsymtable,staticsymtable,objectsymtable]) and
if not(symtablestack.top.symtabletype in [globalsymtable,staticsymtable,objectsymtable,recordsymtable]) and
not assigned(genericlist) then
Message(parser_e_no_local_objects);

28
tests/test/terecs11.pp Normal file
View File

@ -0,0 +1,28 @@
program texrec1;
{$ifdef fpc}
{$mode delphi}
{$endif}
type
TRecord = record
private type
TTestClass = class
end;
TTestRecord = record
end;
TTestObject = object
end;
TTestInterface = interface
end;
TTestString = String[20];
TTestRange = 0..42;
end;
begin
end.