mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
Disallow initializers in anonymous delegate type references
This commit is contained in:
parent
f411c4cf4c
commit
15fd1b5f3f
1 changed files with 7 additions and 1 deletions
|
@ -4829,7 +4829,7 @@ BfTypeReference* BfReducer::DoCreateTypeRef(BfAstNode* firstNode, CreateTypeRefF
|
||||||
auto tokenNode = BfNodeDynCast<BfTokenNode>(firstNode);
|
auto tokenNode = BfNodeDynCast<BfTokenNode>(firstNode);
|
||||||
if (tokenNode != NULL)
|
if (tokenNode != NULL)
|
||||||
{
|
{
|
||||||
int token = tokenNode->GetToken();
|
BfToken token = tokenNode->GetToken();
|
||||||
if (token == BfToken_Dot)
|
if (token == BfToken_Dot)
|
||||||
{
|
{
|
||||||
auto dotTypeRef = mAlloc->Alloc<BfDotTypeReference>();
|
auto dotTypeRef = mAlloc->Alloc<BfDotTypeReference>();
|
||||||
|
@ -4998,6 +4998,12 @@ BfTypeReference* BfReducer::DoCreateTypeRef(BfAstNode* firstNode, CreateTypeRefF
|
||||||
MEMBER_SET_CHECKED(delegateTypeRef, mCloseParen, closeNode);
|
MEMBER_SET_CHECKED(delegateTypeRef, mCloseParen, closeNode);
|
||||||
mVisitorPos.MoveNext();
|
mVisitorPos.MoveNext();
|
||||||
|
|
||||||
|
for (auto paramDecl : params)
|
||||||
|
{
|
||||||
|
if ((paramDecl != NULL) && (paramDecl->mEqualsNode != NULL))
|
||||||
|
Fail(StrFormat("Initializers cannot be used in anonymous %s type references. Consider creating a named %s type.", BfTokenToString(token), BfTokenToString(token)), paramDecl->mEqualsNode);
|
||||||
|
}
|
||||||
|
|
||||||
isHandled = true;
|
isHandled = true;
|
||||||
firstNode = delegateTypeRef;
|
firstNode = delegateTypeRef;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue