mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Allow mixins and expression blocks to end in a ref expression
This commit is contained in:
parent
3cc0ba2ed6
commit
5268e103e9
6 changed files with 60 additions and 18 deletions
|
@ -4427,15 +4427,10 @@ BfAstNode* BfReducer::DoCreateStatement(BfAstNode* node, CreateStmtFlags createS
|
|||
(unaryOperatorExpr->mOp == BfUnaryOp_Decrement) ||
|
||||
(unaryOperatorExpr->mOp == BfUnaryOp_PostDecrement);
|
||||
|
||||
if ((unaryOperatorExpr->mOp == BfUnaryOp_Ref) || (unaryOperatorExpr->mOp == BfUnaryOp_Mut) || (unaryOperatorExpr->mOp == BfUnaryOp_Out))
|
||||
if (unaryOperatorExpr->mOp == BfUnaryOp_Out)
|
||||
{
|
||||
if (unaryOperatorExpr->mOp == BfUnaryOp_Ref)
|
||||
Fail("Cannot use 'ref' in this context", unaryOperatorExpr);
|
||||
else if (unaryOperatorExpr->mOp == BfUnaryOp_Mut)
|
||||
Fail("Cannot use 'mut' in this context", unaryOperatorExpr);
|
||||
else
|
||||
Fail("Cannot use 'out' in this context", unaryOperatorExpr);
|
||||
return NULL;
|
||||
unaryOperatorExpr->mOp = BfUnaryOp_Ref;
|
||||
Fail("Cannot use 'out' in this context", unaryOperatorExpr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue