mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 20:42:21 +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
|
@ -515,6 +515,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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue