-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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`
- Loading branch information
Showing
2 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
class Foo | ||
|
||
extension (dfVal: Foo) | ||
def f0(step: Int): Foo = ??? | ||
def f0: Foo = ??? | ||
val v0 = (new Foo).f0 | ||
|
||
extension (dfVal: Foo) | ||
def f1[T](step: Int): Foo = ??? | ||
def f1: Foo = ??? | ||
val v1 = (new Foo).f1 | ||
|
||
extension (dfVal: Foo) | ||
def f2[T](step: Int): Foo = ??? | ||
def f2[T]: Foo = ??? | ||
val v2 = (new Foo).f2 | ||
|
||
extension [A](dfVal: Foo) | ||
def f3[T](step: Int): Foo = ??? | ||
def f3: Foo = ??? | ||
val v3 = (new Foo).f3 | ||
|
||
extension [A](dfVal: Foo) | ||
def f4[T](step: Int): Foo = ??? | ||
def f4[T]: Foo = ??? | ||
val v4 = (new Foo).f4 |