mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-21 01:49:08 +02:00
Fixing trying to consume ID for anonymous switch field
This commit is contained in:
parent
f1317e893d
commit
ba55932929
@ -1982,6 +1982,8 @@ implementation
|
|||||||
|
|
||||||
{ including a field declaration? }
|
{ including a field declaration? }
|
||||||
fieldvs:=nil;
|
fieldvs:=nil;
|
||||||
|
if token=_ID then
|
||||||
|
begin
|
||||||
sorg:=orgpattern;
|
sorg:=orgpattern;
|
||||||
hs:=pattern;
|
hs:=pattern;
|
||||||
searchsym(hs,srsym,srsymtable);
|
searchsym(hs,srsym,srsymtable);
|
||||||
@ -1993,6 +1995,7 @@ implementation
|
|||||||
variantdesc^^.variantselector:=fieldvs;
|
variantdesc^^.variantselector:=fieldvs;
|
||||||
symtablestack.top.insertsym(fieldvs);
|
symtablestack.top.insertsym(fieldvs);
|
||||||
end;
|
end;
|
||||||
|
end;
|
||||||
read_anon_type(casetype,true);
|
read_anon_type(casetype,true);
|
||||||
block_type:=bt_var;
|
block_type:=bt_var;
|
||||||
if assigned(fieldvs) then
|
if assigned(fieldvs) then
|
||||||
|
19
tests/test/tvrec1.pp
Normal file
19
tests/test/tvrec1.pp
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
program tvrec1;
|
||||||
|
|
||||||
|
type
|
||||||
|
TTestRec = record
|
||||||
|
case (A, B) of
|
||||||
|
A: (I: Integer);
|
||||||
|
B: (D: Double);
|
||||||
|
end;
|
||||||
|
|
||||||
|
var
|
||||||
|
rec: TTestRec;
|
||||||
|
begin
|
||||||
|
if @rec.I=@rec.D then
|
||||||
|
begin
|
||||||
|
WriteLn('ok');
|
||||||
|
halt(0);
|
||||||
|
end;
|
||||||
|
halt(1);
|
||||||
|
end.
|
Loading…
Reference in New Issue
Block a user