* don't generate a hidden parameter for static class methods, resolves #10998

git-svn-id: trunk@10876 -
This commit is contained in:
florian 2008-05-04 07:43:24 +00:00
parent 19c7d1d14c
commit 95c69a64ad
3 changed files with 24 additions and 0 deletions

1
.gitattributes vendored
View File

@ -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

View File

@ -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
View 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.