Commit 0eee3b0
authored
Tweak tryParameterless to use readapt (#24078)
Readapt will autoapply if permitted and also warn on migration.
Fixes #21207
### Why was the ticket worth tackling?
I started to look at tickets about overloading, so this is a first step
on the journey of understanding the parts involved.
It happens that I backported `tryParameterless` to Scala 2.
### How I fixed it
There are just two places where it adds parens.
My first attempt was more direct, since I want only a possible warning
and parens:
```
alt.info match
case wtp: MethodType => adaptNoArgsUnappliedMethod(wtp, functionExpected = false, arity = -1)
```
but the tree has an overloaded type.
### Why is this PR worth reviewing?
It's a one-line change, so now I'm on pace for 1 LOC/day, which is net
zero.
### What's the worse that could happen?
The fix is a bit indirect, so it's easy to imagine it breaking under
strain.File tree
4 files changed
+64
-7
lines changed- compiler/src/dotty/tools/dotc/typer
- tests
- neg
- warn/i21207
4 files changed
+64
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4274 | 4274 | | |
4275 | 4275 | | |
4276 | 4276 | | |
4277 | | - | |
| 4277 | + | |
4278 | 4278 | | |
4279 | 4279 | | |
4280 | 4280 | | |
4281 | | - | |
4282 | | - | |
4283 | | - | |
4284 | | - | |
4285 | | - | |
4286 | | - | |
| 4281 | + | |
| 4282 | + | |
| 4283 | + | |
| 4284 | + | |
| 4285 | + | |
4287 | 4286 | | |
4288 | 4287 | | |
4289 | 4288 | | |
| |||
4976 | 4975 | | |
4977 | 4976 | | |
4978 | 4977 | | |
| 4978 | + | |
4979 | 4979 | | |
4980 | 4980 | | |
4981 | 4981 | | |
| |||
| 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 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 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 | + | |
0 commit comments