Skip to content

Commit 8505d6d

Browse files
committed
[CSBindings] Revert changes in BindingSet::isViable
This change although correct cases performance issues in some scenarios.
1 parent 4f32598 commit 8505d6d

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

lib/Sema/CSBindings.cpp

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,19 +1208,7 @@ bool BindingSet::isViable(PotentialBinding &binding, bool isTransitive) {
12081208
if (!existingNTD || NTD != existingNTD)
12091209
continue;
12101210

1211-
// What is going on here needs to be thoroughly re-evaluated,
1212-
// but at least for now, let's not filter bindings of different
1213-
// kinds so if we have a situation like: `Array<$T0> conv $T1`
1214-
// and `$T1 conv Array<(String, Int)>` we can't lose `Array<$T0>`
1215-
// as a binding because `$T0` could be inferred to
1216-
// `(key: String, value: Int)` and binding `$T1` to `Array<(String, Int)>`
1217-
// eagerly would be incorrect.
1218-
if (existing->Kind != binding.Kind) {
1219-
// Array, Set and Dictionary allow conversions, everything else
1220-
// requires their generic arguments to match exactly.
1221-
if (existingType->isKnownStdlibCollectionType())
1222-
continue;
1223-
}
1211+
// FIXME: What is going on here needs to be thoroughly re-evaluated.
12241212

12251213
// If new type has a type variable it shouldn't
12261214
// be considered viable.

0 commit comments

Comments
 (0)