You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ConstraintSystem] Fix non-determinism in diagnoseAmbiguity
Simplification of member locator would produce a base expression,
this is what we want for diagnostics but not for comparisons in
`diagnoseAmbiguity` because base expression is located at a different
depth which would lead to incorrect results if both reference and base
expression are ambiguous e.g. `test[x].count` if both `[x]` and `count`
are ambiguous than simplification of `count` would produce `[x]` which
is incorrect.
This is the test-case (already in the suite) that exibits this behavior:
```
func test_ambiguity_with_placeholders(pairs: [(rank: Int, count: Int)]) -> Bool {
return pairs[<#^ARG^#>].count == 2
}
```
Here subscript would either return a tuple or `ArraySlice` and
`count` is ambiguous because both have it.
0 commit comments