mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-09 03:52:19 +02:00
Added 'in' parameter support
This commit is contained in:
parent
bf97870ed4
commit
4d1672fbcf
8 changed files with 52 additions and 16 deletions
|
@ -2069,7 +2069,8 @@ bool BfMethodMatcher::CheckMethod(BfTypeInstance* targetTypeInstance, BfTypeInst
|
|||
}
|
||||
else
|
||||
{
|
||||
if ((mAllowImplicitRef) && (wantType->IsRef()) && (!argTypedValue.mType->IsRef()))
|
||||
if ((wantType->IsRef()) && (!argTypedValue.mType->IsRef()) &&
|
||||
((mAllowImplicitRef) || (wantType->IsIn())))
|
||||
wantType = wantType->GetUnderlyingType();
|
||||
if (!mModule->CanCast(argTypedValue, wantType))
|
||||
goto NoMatch;
|
||||
|
@ -3662,7 +3663,7 @@ BfTypedValue BfExprEvaluator::LoadLocal(BfLocalVariable* varDecl, bool allowRef)
|
|||
}
|
||||
}
|
||||
|
||||
localResult = BfTypedValue(varDecl->mValue, innerType, BfTypedValueKind_Addr);
|
||||
localResult = BfTypedValue(varDecl->mValue, innerType, varDecl->mIsReadOnly ? BfTypedValueKind_ReadOnlyAddr : BfTypedValueKind_Addr);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -7011,8 +7012,8 @@ BfTypedValue BfExprEvaluator::CreateCall(BfAstNode* targetSrc, const BfTypedValu
|
|||
if (refNode == NULL)
|
||||
refNode = targetSrc;
|
||||
|
||||
if (((callFlags & BfCreateFallFlags_AllowImplicitRef) != 0) &&
|
||||
(wantType->IsRef()) && (!argValue.mType->IsRef()))
|
||||
if ((wantType->IsRef()) && (!argValue.mType->IsRef()) &&
|
||||
(((callFlags & BfCreateFallFlags_AllowImplicitRef) != 0) || (wantType->IsIn())))
|
||||
argValue = mModule->ToRef(argValue, (BfRefType*)wantType);
|
||||
|
||||
if (mModule->mCurMethodState != NULL)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue