-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adapt tupled apply insertion for case companion
- Loading branch information
Showing
6 changed files
with
57 additions
and
12 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
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,11 @@ | ||
t3664c.scala:9: error: type mismatch; | ||
found : C.type | ||
required: ((Int, Int, Int)) => C | ||
def f(xs: List[(Int, Int, Int)]): List[C] = xs.map(C) // hard error | ||
^ | ||
t3664c.scala:11: error: type mismatch; | ||
found : ((Int, Int)) => C | ||
required: ((Int, Int, Int)) => C | ||
def g(xs: List[(Int, Int, Int)]): List[C] = xs.map(C.tupled) // hard error | ||
^ | ||
2 errors |
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,12 @@ | ||
//> using options -Werror -Xlint -Xsource:3-cross | ||
|
||
// use -Xsource:3 to warn that implicitly extending Function is deprecated | ||
// use -Xsource:3-cross for dotty behavior: no extend Function, yes adapt C.apply.tupled | ||
|
||
case class C(i: Int, j: Int) | ||
|
||
class Test { | ||
def f(xs: List[(Int, Int, Int)]): List[C] = xs.map(C) // hard error | ||
|
||
def g(xs: List[(Int, Int, Int)]): List[C] = xs.map(C.tupled) // hard error | ||
} |
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