-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quote pattern not matching on *:
#19947
Labels
Milestone
Comments
nicolasstucki
added
itype:bug
area:metaprogramming:quotes
Issues related to quotes and splices
labels
Mar 14, 2024
Minimizationimport scala.quoted.*
inline def expandMacro(inline from: Tuple): Any =
${ expandMacroImpl }
def expandMacroImpl(using Quotes): Expr[?] =
'{ 1 *: EmptyTuple } match
case '{ ($hd: Int) *: ($tl: Tuple) } => '{ ??? }
case x => throw new MatchError(x.show) |
The pattern is typed as case
'{
{
val x$1: Int = ${hd @ _}:Int
(${tl @ _}:Tuple).*:[Int, Tuple](x$1)
}
}
=> The |
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Mar 14, 2024
nicolasstucki
added a commit
to dotty-staging/dotty
that referenced
this issue
Mar 14, 2024
nicolasstucki
added a commit
that referenced
this issue
Mar 19, 2024
In quoted patterns, we do not want to generate the val bindings. We care about the original structure if the pattern expression. Fixes #19947
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compiler version
3.4.0
Minimized code
Output
Expectation
Should match
The text was updated successfully, but these errors were encountered: