* raise an exception if routine to be invoked isn't static, but there's no parameter to be used as Self

git-svn-id: trunk@37386 -
This commit is contained in:
svenbarth 2017-10-02 19:39:37 +00:00
parent 794eb7c122
commit 98bb449945

View File

@ -341,6 +341,7 @@ resourcestring
SErrCallConvNotSupported = 'Calling convention not supported: %s';
SErrTypeKindNotSupported = 'Type kind is not supported: %s';
SErrCallbackHandlerNil = 'Callback handler is Nil';
SErrMissingSelfParam = 'Missing self parameter';
implementation
@ -545,10 +546,11 @@ begin
if aIsConstructor then
raise ENotImplemented.Create(SErrInvokeNotImplemented);
{ ToDo: what exactly is the purpose of IsStatic? }
flags := [];
if aIsStatic then
Include(flags, fcfStatic);
Include(flags, fcfStatic)
else if Length(aArgs) = 0 then
raise EInvocationError.Create(SErrMissingSelfParam);
SetLength(funcargs, Length(aArgs));
for i := Low(aArgs) to High(aArgs) do begin