-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Using Quotes inside the body of a destructuring lambda breaks type inference #15715
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
Labels
Comments
Actually it looks like the second workaround makes things compile in this particular case but then the result type is different: def macroImpl(using q: Quotes): Option[Expr[Int]] =
val expr = Expr(1)
Some((1, 2)).map { (x, y) =>
given Quotes = q
'{ ${expr} + 1 }
} |
jchyb
added a commit
to jchyb/dotty
that referenced
this issue
Jun 30, 2023
jchyb
added a commit
to jchyb/dotty
that referenced
this issue
Jun 30, 2023
jchyb
added a commit
to jchyb/dotty
that referenced
this issue
Jun 30, 2023
Kordyjan
added a commit
that referenced
this issue
Jun 30, 2023
Kordyjan
added a commit
that referenced
this issue
Dec 8, 2023
Backports #18105 to the LTS branch. PR submitted by the release tooling. [skip ci]
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Compiler version
3.2.1-RC1-bin-20220720-6c7acf9-NIGHTLY and earlier
Minimized code
Output
Expectation
This should compile successfully as it does when the lambda takes a single parameter which gets destructured later on, e.g.
An alternative workaround is to make the body of the lambda a context function explicitly
The text was updated successfully, but these errors were encountered: