mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-13 22:04:09 +02:00
Allowed generic inference from tuples
This commit is contained in:
parent
ad89d4cc82
commit
3d191b6cc5
1 changed files with 18 additions and 0 deletions
|
@ -516,6 +516,24 @@ bool BfGenericInferContext::InferGenericArgument(BfMethodInstance* methodInstanc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (wantType->IsTuple())
|
||||||
|
{
|
||||||
|
if (argType->IsTuple())
|
||||||
|
{
|
||||||
|
auto wantTupleType = (BfTupleType*)wantType;
|
||||||
|
auto argTupleType = (BfTupleType*)argType;
|
||||||
|
|
||||||
|
if (wantTupleType->mFieldInstances.size() == argTupleType->mFieldInstances.size())
|
||||||
|
{
|
||||||
|
for (int fieldIdx = 0; fieldIdx < (int)wantTupleType->mFieldInstances.size(); fieldIdx++)
|
||||||
|
{
|
||||||
|
InferGenericArgument(methodInstance, argTupleType->mFieldInstances[fieldIdx].mResolvedType,
|
||||||
|
wantTupleType->mFieldInstances[fieldIdx].mResolvedType, BfIRValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue