1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-23 18:18:00 +02:00

Fixed early-exit cases in ctor

This commit is contained in:
Brian Fiete 2020-12-04 06:29:25 -08:00
parent 687dde063f
commit 195a699af4
3 changed files with 33 additions and 3 deletions

View file

@ -4891,7 +4891,11 @@ void BfModule::Visit(BfReturnStatement* returnStmt)
}
return;
}
checkScope = checkScope->mPrevScope;
if (checkScope->mInInitBlock)
{
Fail("Initialization blocks cannot contain 'return' statements", returnStmt);
}
checkScope = checkScope->mPrevScope;
}
auto checkLocalAssignData = mCurMethodState->mDeferredLocalAssignData;