* better error recovery, resolves #36397

git-svn-id: trunk@43653 -
This commit is contained in:
florian 2019-12-05 20:46:50 +00:00
parent 266daa62f1
commit ac6e4f59c6
3 changed files with 27 additions and 1 deletions

1
.gitattributes vendored
View File

@ -16100,6 +16100,7 @@ tests/webtbf/tw36223.pp svneol=native#text/pascal
tests/webtbf/tw3626.pp svneol=native#text/plain
tests/webtbf/tw3631.pp svneol=native#text/plain
tests/webtbf/tw36377.pp svneol=native#text/pascal
tests/webtbf/tw36397.pp -text svneol=native#text/pascal
tests/webtbf/tw3643.pp svneol=native#text/plain
tests/webtbf/tw3644.pp svneol=native#text/plain
tests/webtbf/tw3662.pp svneol=native#text/plain

View File

@ -1380,7 +1380,12 @@ implementation
not(po_staticmethod in tcallnode(p1).procdefinition.procoptions) and
(not assigned(current_structdef) or
not def_is_related(current_structdef,structh)) then
Message(parser_e_only_static_members_via_object_type);
begin
p1.free;
p1:=cerrornode.create;
Message(parser_e_only_static_members_via_object_type);
exit;
end;
end;
{ in Java, constructors are not automatically inherited
-> calling a constructor from a parent type will create

20
tests/webtbf/tw36397.pp Normal file
View File

@ -0,0 +1,20 @@
{ %fail }
program Project1;
{$mode delphi}
type
TTest = object
class procedure myproc;
end;
class procedure TTest.myproc;
begin
end;
var
p: procedure;
begin
p := TTest.myproc;
end.