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

Proper error for anonymous type declarations in emitted code

This commit is contained in:
Brian Fiete 2025-01-05 09:07:36 -08:00
parent 854122cb46
commit 61a3328c5a

View file

@ -49,6 +49,7 @@ BfReducer::BfReducer()
mMethodDepth = 0;
mDocumentCheckIdx = 0;
mTypeMemberNodeStart = NULL;
mCurTypeState = NULL;
}
bool BfReducer::IsSemicolon(BfAstNode* node)
@ -8260,7 +8261,13 @@ void BfReducer::InitAnonymousType(BfTypeDeclaration* typeDecl)
memcpy(typeDecl->mAnonymousName, name.c_str(), len);
if (mCurTypeState != NULL)
{
mCurTypeState->mAnonymousTypeDecls.Add(typeDecl);
}
else
{
Fail("Type declarations are not allowed in emitted code", typeDecl);
}
}
bool BfReducer::CheckInlineTypeRefAttribute(BfAstNode* typeRef, BfAttributeDirective* attributes)