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

Fix dangling error when typing delegate, disallow method body after delegate type

This commit is contained in:
Fusioon 2024-09-07 10:12:37 +02:00
parent b5ceaf9a4e
commit 921049ba02

View file

@ -8911,10 +8911,15 @@ BfAstNode* BfReducer::CreateTopLevelObject(BfTokenNode* tokenNode, BfAttributeDi
methodDecl->mGenericConstraintsDeclaration = NULL;
}
if (methodDecl->mBody != NULL)
{
Fail("Unexpected method body after delegate/function type", methodDecl->mBody);
}
if (failed)
return typeDeclaration;
if (methodDecl->mEndSemicolon == NULL)
if ((methodDecl->mEndSemicolon == NULL) && (methodDecl->mCloseParen != NULL))
FailAfter("Expected ';'", methodDecl->mCloseParen);
//MEMBER_SET(methodDecl, mReturnType, retType);