mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 01:39:27 +02:00
* better error recovery, resolves #39485
This commit is contained in:
parent
d5b368988f
commit
c6874df5c8
@ -165,6 +165,8 @@ implementation
|
||||
procedure struct_property_dec(is_classproperty:boolean;var rtti_attrs_def: trtti_attribute_list);
|
||||
var
|
||||
p : tpropertysym;
|
||||
_deprecatedmsg: pshortstring;
|
||||
_symoptions: tsymoptions;
|
||||
begin
|
||||
{ check for a class, record or helper }
|
||||
if not((is_class_or_interface_or_dispinterface(current_structdef) or is_record(current_structdef) or
|
||||
@ -214,12 +216,25 @@ implementation
|
||||
Message(parser_e_enumerator_identifier_required);
|
||||
consume(_SEMICOLON);
|
||||
end;
|
||||
trtti_attribute_list.bind(rtti_attrs_def,p.rtti_attribute_list);
|
||||
{ in case of a previous error, p might not be assigned }
|
||||
if assigned(p) then
|
||||
begin
|
||||
trtti_attribute_list.bind(rtti_attrs_def,p.rtti_attribute_list);
|
||||
|
||||
{ hint directives, these can be separated by semicolons here,
|
||||
that needs to be handled here with a loop (PFV) }
|
||||
while try_consume_hintdirective(p.symoptions,p.deprecatedmsg) do
|
||||
Consume(_SEMICOLON);
|
||||
{ hint directives, these can be separated by semicolons here,
|
||||
that needs to be handled here with a loop (PFV) }
|
||||
while try_consume_hintdirective(p.symoptions,p.deprecatedmsg) do
|
||||
Consume(_SEMICOLON);
|
||||
end
|
||||
else
|
||||
begin
|
||||
{ recover from error so we can continue to parse }
|
||||
|
||||
{ hint directives, these can be separated by semicolons here,
|
||||
that needs to be handled here with a loop (PFV) }
|
||||
while try_consume_hintdirective(_symoptions,_deprecatedmsg) do
|
||||
Consume(_SEMICOLON);
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
|
20
tests/tbf/tw39485.pp
Normal file
20
tests/tbf/tw39485.pp
Normal file
@ -0,0 +1,20 @@
|
||||
{ %fail }
|
||||
program Project1;
|
||||
{$mode objfpc}{$H+}{$Interfaces CORBA}
|
||||
|
||||
type
|
||||
ITest = interface
|
||||
end;
|
||||
|
||||
TBar = class;
|
||||
|
||||
TFoo = class(TObject, ITest)
|
||||
Fa: TBar;
|
||||
property a: TBar read Fa implements ITest;
|
||||
end;
|
||||
|
||||
TBar = class(TObject, ITest)
|
||||
end;
|
||||
|
||||
begin
|
||||
end.
|
Loading…
Reference in New Issue
Block a user