Commit 99aa063
committed
Sema: Try harder to avoid tautological inference by looking at reduced types
If a requirement `f(_: Self.Element)` has a default implementation
`f(_: Self.Iterator.Element)` where `Self: Sequence` for example,
we don't want to consider the witness as a source of inference,
because `Self.Element == Self.Iterator.Element` is always true.
Compute the reduced type of the witness, so that we can rule out
such cases using the existing logic.1 parent 335d6ff commit 99aa063
1 file changed
+12
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
662 | 662 | | |
663 | 663 | | |
664 | 664 | | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
665 | 677 | | |
666 | 678 | | |
667 | 679 | | |
| |||
0 commit comments