1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 20:42:21 +02:00

Fixed extension method issues where 'this' type is missing

This commit is contained in:
Brian Fiete 2020-12-01 10:57:10 -08:00
parent 1b19eeb96e
commit d976ea77e9

View file

@ -425,7 +425,7 @@ BfMethodDef* BfDefBuilder::CreateMethodDef(BfMethodDeclaration* methodDeclaratio
methodDef->mIsExtern = methodDeclaration->mExternSpecifier != NULL;
methodDef->mBody = methodDeclaration->mBody;
if (methodDeclaration->mThisToken != NULL)
if ((methodDeclaration->mThisToken != NULL) && (!methodDeclaration->mParams.IsEmpty()))
methodDef->mMethodType = BfMethodType_Extension;
HashContext signatureHashCtx;
@ -589,7 +589,7 @@ BfMethodDef* BfDefBuilder::CreateMethodDef(BfMethodDeclaration* methodDeclaratio
methodDef->mName = methodDeclaration->mNameNode->ToString();
methodDef->mMethodType = BfMethodType_Normal;
if (methodDeclaration->mThisToken != NULL)
if ((methodDeclaration->mThisToken != NULL) && (!methodDeclaration->mParams.IsEmpty()))
{
methodDef->mMethodType = BfMethodType_Extension;
mCurTypeDef->mHasExtensionMethods = true;