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:
parent
854122cb46
commit
61a3328c5a
1 changed files with 7 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue