1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 04:22:20 +02:00

For for 'in' with unqualified dot constructor

This commit is contained in:
Brian Fiete 2024-07-23 13:39:16 +02:00
parent 62a171c649
commit b0b85b7b43
2 changed files with 26 additions and 0 deletions

View file

@ -18145,6 +18145,18 @@ void BfExprEvaluator::DoInvocation(BfAstNode* target, BfMethodBoundExpression* m
expectingType = underlyingType;
}
BfType* inRefType = NULL;
if ((expectingType != NULL) && (expectingType->IsRef()))
{
auto refType = (BfRefType*)expectingType;
if (refType->mRefKind == BfRefType::RefKind_In)
{
inRefType = expectingType;
auto underlyingType = expectingType->GetUnderlyingType();
expectingType = underlyingType;
}
}
if (expectingType != NULL)
{
if (expectingType->IsSizedArray())
@ -18188,6 +18200,12 @@ void BfExprEvaluator::DoInvocation(BfAstNode* target, BfMethodBoundExpression* m
mResult = ctorResult;
mModule->ValidateAllocation(expectingType, invocationExpr->mTarget);
if ((inRefType != NULL) && (mResult.mType == expectingType) && (mResult.IsAddr()))
{
// Put back the 'in'
mResult = BfTypedValue(mResult.mValue, inRefType);
}
return;
}
}