forked from scala/scala
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do less in typedFunction after typer
Do more for typedFunction of eta-expanded method: keep typed method selection (fix scala/bug#9745, follow up for scala#6007) Test case taken from original PR.
- Loading branch information
Showing
4 changed files
with
108 additions
and
42 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,19 @@ | ||
t9745.scala:2: error: missing parameter type for expanded function ((x$1: <error>) => Seq({ | ||
<x: error>.<$plus$eq: error>(1); | ||
42 | ||
}).apply(x$1)) | ||
val func = Seq { x += 1; 42 } apply _ | ||
^ | ||
t9745.scala:8: error: missing parameter type | ||
val g = x => f(y += 1)(x) | ||
^ | ||
t9745.scala:14: error: missing parameter type | ||
val g = x => f(x += 1)(x) | ||
^ | ||
t9745.scala:19: error: missing parameter type | ||
val g = (x, y) => f(42)(x, y) | ||
^ | ||
t9745.scala:19: error: missing parameter type | ||
val g = (x, y) => f(42)(x, y) | ||
^ | ||
5 errors found |
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,20 @@ | ||
class C { | ||
val func = Seq { x += 1; 42 } apply _ | ||
} | ||
|
||
class D { | ||
var i = 0 | ||
def f(n: Unit)(j: Int): Int = ??? | ||
val g = x => f(y += 1)(x) | ||
} | ||
|
||
class E { | ||
var i = 0 | ||
def f(n: Unit)(j: Int): Int = ??? | ||
val g = x => f(x += 1)(x) | ||
} | ||
|
||
class Convo { | ||
def f(i: Int)(z: Any): Int = ??? | ||
val g = (x, y) => f(42)(x, y) | ||
} |
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,14 @@ | ||
class C { | ||
val func = Seq { var i = 0; i += 1; i } apply _ | ||
} | ||
|
||
class D { | ||
var i = 0 | ||
def f(n: Unit)(j: Int): Int = ??? | ||
val g = x => f(i += 1)(x) | ||
} | ||
|
||
class Convo { | ||
def f(i: Int)(z: Any): Int = ??? | ||
val g = (x: Int, y: Int) => f(42)(x, y) | ||
} |