forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implements SIP scala#897.
- Loading branch information
Showing
5 changed files
with
87 additions
and
19 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
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,22 @@ | ||
object Test { | ||
|
||
// From #873: | ||
|
||
trait X extends Function1[Int, String] | ||
implicit def f2x(f: Function1[Int, String]): X = ??? | ||
({case _ if "".isEmpty => 0} : X) // error: expected String, found Int | ||
|
||
// Tests where parameter list cannot be made into a pattern | ||
|
||
def unary[T](x: T => Unit) = ??? | ||
unary((x, y) => ()) // error | ||
|
||
unary[(Int, Int)]((x, y) => ()) | ||
|
||
unary[(Int, Int)](() => ()) // error | ||
unary[(Int, Int)]((x, y, _) => ()) // error | ||
|
||
unary[(Int, Int)]((x: String, y) => ()) // 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