mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-14 14:24:10 +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;
|
mMethodDepth = 0;
|
||||||
mDocumentCheckIdx = 0;
|
mDocumentCheckIdx = 0;
|
||||||
mTypeMemberNodeStart = NULL;
|
mTypeMemberNodeStart = NULL;
|
||||||
|
mCurTypeState = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BfReducer::IsSemicolon(BfAstNode* node)
|
bool BfReducer::IsSemicolon(BfAstNode* node)
|
||||||
|
@ -8260,7 +8261,13 @@ void BfReducer::InitAnonymousType(BfTypeDeclaration* typeDecl)
|
||||||
memcpy(typeDecl->mAnonymousName, name.c_str(), len);
|
memcpy(typeDecl->mAnonymousName, name.c_str(), len);
|
||||||
|
|
||||||
if (mCurTypeState != NULL)
|
if (mCurTypeState != NULL)
|
||||||
|
{
|
||||||
mCurTypeState->mAnonymousTypeDecls.Add(typeDecl);
|
mCurTypeState->mAnonymousTypeDecls.Add(typeDecl);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Fail("Type declarations are not allowed in emitted code", typeDecl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BfReducer::CheckInlineTypeRefAttribute(BfAstNode* typeRef, BfAttributeDirective* attributes)
|
bool BfReducer::CheckInlineTypeRefAttribute(BfAstNode* typeRef, BfAttributeDirective* attributes)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue