Commit 9cbc48b
authored
Fix i14451 (#16010)
Fixes #14451
Implicitly assumed type clauses could only be at the beginning, which is
wrong since:
```scala
extension (x: Int) def foo[T](y: T) = ???
```
de-sugars to something like:
```scala
def foo(x: Int)[T](y: T) = ???
```
To fix it, I implement `stripInferrable`, a variant of `stripImplicit`
which also drops type clauses, and use it in `resultIsMethod`
I suspect the other uses of `stripImplicit` could be simplified, or even
fixed (assuming they make the same mistake as `resultIsMethod`), by
using `stripInferrable`File tree
2 files changed
+39
-2
lines changed- compiler/src/dotty/tools/dotc/typer
- tests/pos
2 files changed
+39
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1473 | 1473 | | |
1474 | 1474 | | |
1475 | 1475 | | |
1476 | | - | |
| 1476 | + | |
| 1477 | + | |
| 1478 | + | |
| 1479 | + | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
1477 | 1487 | | |
1478 | 1488 | | |
1479 | 1489 | | |
| |||
2042 | 2052 | | |
2043 | 2053 | | |
2044 | 2054 | | |
2045 | | - | |
| 2055 | + | |
2046 | 2056 | | |
2047 | 2057 | | |
2048 | 2058 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
0 commit comments