mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Fixed a var-return case with generics methods specialized with var
This commit is contained in:
parent
9030d86562
commit
e887b2fb59
2 changed files with 6 additions and 2 deletions
|
@ -8903,6 +8903,8 @@ BfTypedValue BfExprEvaluator::MatchMethod(BfAstNode* targetSrc, BfMethodBoundExp
|
||||||
if (!moduleMethodInstance)
|
if (!moduleMethodInstance)
|
||||||
{
|
{
|
||||||
FinishDeferredEvals(argValues);
|
FinishDeferredEvals(argValues);
|
||||||
|
if (mModule->IsInUnspecializedGeneric())
|
||||||
|
return mModule->GetDefaultTypedValue(mModule->GetPrimitiveType(BfTypeCode_Var));
|
||||||
return BfTypedValue();
|
return BfTypedValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14146,8 +14146,10 @@ bool BfModule::IsInSpecializedSection()
|
||||||
|
|
||||||
bool BfModule::IsInUnspecializedGeneric()
|
bool BfModule::IsInUnspecializedGeneric()
|
||||||
{
|
{
|
||||||
if (mCurMethodInstance != NULL)
|
if ((mCurMethodInstance != NULL) && (mCurMethodInstance->mIsUnspecialized))
|
||||||
return mCurMethodInstance->mIsUnspecialized;
|
return true;
|
||||||
|
if ((mCurTypeInstance != NULL) && (mCurTypeInstance->IsUnspecializedType()))
|
||||||
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue