mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 12:02:21 +02:00
Fixed error handling of return value of lambda in local
This commit is contained in:
parent
74098aa9eb
commit
56c250f251
1 changed files with 16 additions and 3 deletions
|
@ -2807,9 +2807,17 @@ BfError* BfModule::Fail(const StringImpl& error, BfAstNode* refNode, bool isPers
|
|||
{
|
||||
//auto unspecializedMethod = &mCurMethodInstance->mMethodInstanceGroup->mMethodSpecializationMap.begin()->second;
|
||||
auto unspecializedMethod = methodInstance->mMethodInstanceGroup->mDefault;
|
||||
if (unspecializedMethod == methodInstance)
|
||||
{
|
||||
// This is a local method inside a generic method
|
||||
BF_ASSERT(methodInstance->mMethodDef->mIsLocalMethod);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (unspecializedMethod->mHasFailed)
|
||||
return false; // At least SOME error has already been reported
|
||||
}
|
||||
}
|
||||
|
||||
if (isSpecializedMethod)
|
||||
{
|
||||
|
@ -20040,7 +20048,12 @@ BfModuleMethodInstance BfModule::GetLocalMethodInstance(BfLocalMethod* localMeth
|
|||
VisitCodeBlock(blockBody);
|
||||
}
|
||||
else if (auto bodyExpr = BfNodeDynCast<BfExpression>(body))
|
||||
CreateValueFromExpression(bodyExpr);
|
||||
{
|
||||
BfType* expectType = NULL;
|
||||
if (!methodInstance->mReturnType->IsVoid())
|
||||
expectType = methodInstance->mReturnType;
|
||||
CreateValueFromExpression(bodyExpr, expectType);
|
||||
}
|
||||
};
|
||||
|
||||
auto _SafeResolveTypeRef = [&](BfTypeReference* typeRef)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue