mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-04 13:50:36 +02:00
compiler: allow class declarations inside records (1 part of issue #0019099)
git-svn-id: trunk@17335 -
This commit is contained in:
parent
56cd7b3450
commit
550ad700c3
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -9695,6 +9695,7 @@ tests/test/tenum6.pp svneol=native#text/pascal
|
|||||||
tests/test/tenumerators1.pp svneol=native#text/pascal
|
tests/test/tenumerators1.pp svneol=native#text/pascal
|
||||||
tests/test/terecs1.pp svneol=native#text/pascal
|
tests/test/terecs1.pp svneol=native#text/pascal
|
||||||
tests/test/terecs10.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/terecs2.pp svneol=native#text/pascal
|
||||||
tests/test/terecs3.pp svneol=native#text/pascal
|
tests/test/terecs3.pp svneol=native#text/pascal
|
||||||
tests/test/terecs4.pp svneol=native#text/pascal
|
tests/test/terecs4.pp svneol=native#text/pascal
|
||||||
|
@ -1082,7 +1082,7 @@ implementation
|
|||||||
current_specializedef:=nil;
|
current_specializedef:=nil;
|
||||||
|
|
||||||
{ objects and class types can't be declared local }
|
{ 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
|
not assigned(genericlist) then
|
||||||
Message(parser_e_no_local_objects);
|
Message(parser_e_no_local_objects);
|
||||||
|
|
||||||
|
28
tests/test/terecs11.pp
Normal file
28
tests/test/terecs11.pp
Normal 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.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user