mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 11:38:21 +02:00
Fixed return value from a property indexer failure
This commit is contained in:
parent
d27707cb6b
commit
b6e49673c6
1 changed files with 18 additions and 1 deletions
|
@ -13826,7 +13826,24 @@ BfTypedValue BfExprEvaluator::GetResult(bool clearResult, bool resolveGenericTyp
|
|||
}
|
||||
|
||||
if (failed)
|
||||
mResult = mModule->GetDefaultTypedValue(methodInstance.mMethodInstance->mReturnType);
|
||||
{
|
||||
auto returnType = methodInstance.mMethodInstance->mReturnType;
|
||||
auto methodDef = methodInstance.mMethodInstance->mMethodDef;
|
||||
if (returnType->IsRef())
|
||||
{
|
||||
auto result = mModule->GetDefaultTypedValue(returnType->GetUnderlyingType(), true, BfDefaultValueKind_Addr);
|
||||
if (methodDef->mIsReadOnly)
|
||||
result.mKind = BfTypedValueKind_ReadOnlyAddr;
|
||||
return result;
|
||||
}
|
||||
else
|
||||
{
|
||||
auto val = mModule->GetDefaultTypedValue(returnType, true, methodInstance.mMethodInstance->HasStructRet() ? BfDefaultValueKind_Addr : BfDefaultValueKind_Value);
|
||||
if (val.mKind == BfTypedValueKind_Addr)
|
||||
val.mKind = BfTypedValueKind_TempAddr;
|
||||
return val;
|
||||
}
|
||||
}
|
||||
else
|
||||
mResult = CreateCall(methodInstance.mMethodInstance, methodInstance.mFunc, mPropDefBypassVirtual, args);
|
||||
if (mResult.mType != NULL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue