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.
Handle leading given parameters in inline unapplies
Fixes scala#12991
- Loading branch information
1 parent
eb75a1a
commit d3ff792
Showing
2 changed files
with
30 additions
and
8 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 |