mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[CSOptimizer] Reduce overload types before ranking
This would make sure that any same-type requirements to a concrete
type are substituted with such types which is especially important
for SIMD operators like `&{+, -}` because they have `Scalar == (U)Int*`
requirements.
This commit is contained in:
@@ -780,6 +780,14 @@ static void determineBestChoicesInContext(
|
||||
favorExactMatchesOnly = true;
|
||||
}
|
||||
|
||||
// This is important for SIMD operators in particular because
|
||||
// a lot of their overloads have same-type requires to a concrete
|
||||
// type: `<Scalar == (U)Int*>(_: SIMD*<Scalar>, ...) -> ...`.
|
||||
if (genericSig) {
|
||||
overloadType = overloadType->getReducedType(genericSig)
|
||||
->castTo<FunctionType>();
|
||||
}
|
||||
|
||||
double score = 0.0;
|
||||
unsigned numDefaulted = 0;
|
||||
for (unsigned paramIdx = 0, n = overloadType->getNumParams();
|
||||
|
||||
Reference in New Issue
Block a user