Match quoted tuple prepend #13958
Replies: 2 comments 6 replies
-
The natural assumption you probably made is that The reason behind this is that to keep compatibility with Scala 2 we need to keep the old At some point in the future, when we drop Scala 2 backward compatibility we will be able to simplify this. An alternative to match against the type instead of the constructor. case '{ $tuple : Int *: Tuple } => or case '{ type tail <: Tuple; $tuple : fst *: `tail` } => Though then you cannot extract the elements and would need to call As long as we have |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Compiler version
3.1.2-RC1-bin-20211025-968dd1b-NIGHTLY
Minimized code
Output
Expectation
I expect
'{ $head *: (${tail}: Tuple) }
to catch something matching'{ ($fst, $snd) }
, but I'm new to this area.Beta Was this translation helpful? Give feedback.
All reactions