mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Fixed empty return with lambda return type inference
This commit is contained in:
parent
c598944f52
commit
97d9a4508d
1 changed files with 8 additions and 16 deletions
|
@ -4941,30 +4941,22 @@ void BfModule::Visit(BfReturnStatement* returnStmt)
|
|||
if (returnStmt->mExpression == NULL)
|
||||
{
|
||||
MarkScopeLeft(&mCurMethodState->mHeadScope);
|
||||
if (retType->IsVoid())
|
||||
|
||||
if ((retType != NULL) && (retType->IsVoid()))
|
||||
{
|
||||
EmitReturn(BfTypedValue());
|
||||
return;
|
||||
}
|
||||
|
||||
if (retType != NULL)
|
||||
{
|
||||
Fail("Expected return value", returnStmt);
|
||||
return;
|
||||
}
|
||||
|
||||
EmitReturn(GetDefaultTypedValue(retType));
|
||||
return;
|
||||
Fail("Expected return value", returnStmt);
|
||||
if (retType != NULL)
|
||||
EmitReturn(GetDefaultTypedValue(retType));
|
||||
else
|
||||
EmitReturn(BfTypedValue());
|
||||
return;
|
||||
}
|
||||
|
||||
BfType* expectingReturnType = retType;
|
||||
if ((expectingReturnType != NULL) && (expectingReturnType->IsVar()))
|
||||
{
|
||||
NOP;
|
||||
// expectingReturnType = NULL;
|
||||
}
|
||||
|
||||
|
||||
BfType* origType;
|
||||
BfExprEvaluator exprEvaluator(this);
|
||||
bool alreadyWritten = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue