mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-11 04:52:21 +02:00
Fixed generic assignment operators (ie +=)
This commit is contained in:
parent
c23def10f1
commit
5b18e380a5
4 changed files with 56 additions and 4 deletions
|
@ -13786,7 +13786,9 @@ BfIRValue BfModule::CastToValue(BfAstNode* srcNode, BfTypedValue typedVal, BfTyp
|
|||
// For these casts, it's just important we get *A* value to work with here,
|
||||
// as this is just use for unspecialized parsing. We don't use the generated code
|
||||
{
|
||||
auto genericParamInst = GetGenericParamInstance((BfGenericParamType*)typedVal.mType);
|
||||
auto genericParamInst = GetGenericParamInstance((BfGenericParamType*)typedVal.mType, false, BfFailHandleKind_Soft);
|
||||
if (genericParamInst == NULL)
|
||||
return BfIRValue();
|
||||
retVal = _CheckGenericParamInstance(genericParamInst);
|
||||
if (retVal)
|
||||
return retVal;
|
||||
|
@ -13822,7 +13824,9 @@ BfIRValue BfModule::CastToValue(BfAstNode* srcNode, BfTypedValue typedVal, BfTyp
|
|||
}
|
||||
}
|
||||
|
||||
auto genericParamInst = GetGenericParamInstance((BfGenericParamType*)toType);
|
||||
auto genericParamInst = GetGenericParamInstance((BfGenericParamType*)toType, false, BfFailHandleKind_Soft);
|
||||
if (genericParamInst == NULL)
|
||||
return GetDefaultValue(toType);
|
||||
if (genericParamInst->mGenericParamFlags & BfGenericParamFlag_Var)
|
||||
return GetDefaultValue(toType);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue