-
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.
Handle leading given parameters in inline unapplies
Fixes #12991
- Loading branch information
1 parent
e587a81
commit 14f3793
Showing
2 changed files
with
19 additions
and
7 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,15 @@ | ||
object Foo: | ||
inline def unapply(using String)(i: Int): Some[Int] = Some(i) | ||
|
||
object Bar: | ||
inline def unapply(using String)(using String)(i: Int): Some[Int] = Some(i) | ||
|
||
object Baz: | ||
inline def unapply[T](using String)(i: T): Some[T] = Some(i) | ||
|
||
given String = "" | ||
|
||
val i = 10 match | ||
case Foo(x) => x | ||
case Bar(x) => x | ||
case Baz(x) => x |