mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-24 03:51:39 +02:00
* don't generate a hidden parameter for static class methods, resolves #10998
git-svn-id: trunk@10876 -
This commit is contained in:
parent
19c7d1d14c
commit
95c69a64ad
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -8138,6 +8138,7 @@ tests/webtbs/tw1096.pp svneol=native#text/plain
|
||||
tests/webtbs/tw10966.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1097.pp svneol=native#text/plain
|
||||
tests/webtbs/tw10979.pp svneol=native#text/plain
|
||||
tests/webtbs/tw10998.pp svneol=native#text/plain
|
||||
tests/webtbs/tw11006.pp svneol=native#text/plain
|
||||
tests/webtbs/tw11027.pp svneol=native#text/plain
|
||||
tests/webtbs/tw1103.pp svneol=native#text/plain
|
||||
|
||||
@ -165,6 +165,11 @@ implementation
|
||||
assigned(tprocdef(pd)._class) and
|
||||
(pd.parast.symtablelevel=normal_function_level) then
|
||||
begin
|
||||
{ static class methods have no hidden self/vmt pointer }
|
||||
if (po_staticmethod in pd.procoptions) and
|
||||
(po_classmethod in pd.procoptions) then
|
||||
exit;
|
||||
|
||||
storepos:=current_tokenpos;
|
||||
current_tokenpos:=tprocdef(pd).fileinfo;
|
||||
|
||||
|
||||
18
tests/webtbs/tw10998.pp
Normal file
18
tests/webtbs/tw10998.pp
Normal file
@ -0,0 +1,18 @@
|
||||
program statictest;
|
||||
|
||||
{$mode delphi}{$STATIC ON}
|
||||
|
||||
type
|
||||
TMyClass = class
|
||||
public
|
||||
class procedure StaticCall; static;
|
||||
end;
|
||||
|
||||
class procedure TMyClass.StaticCall;
|
||||
begin
|
||||
WriteLn('Static method was called!');
|
||||
end;
|
||||
|
||||
begin
|
||||
TMyClass.StaticCall;
|
||||
end.
|
||||
Loading…
Reference in New Issue
Block a user