-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Match fails using quasiquotes #8600
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
Comments
Based on followup, it seems that you must use something like |
Is this a documentation issue or an inference issue, because I saw that this worked in the end:
@nicolasstucki I think we can document this for now. WDYT? https://github.com/Blaisorblade/dotty-map-fusion-staging-experiment/pull/1/files |
It's at least a documentation issue; once one describes what's supposed to happen, some more bugs might be there... |
I saw something similar when I had an inline parameter that came from a blackbox inline. There, the extra ascription appears as part of the encoding of the blackbox inline. Is this the case for this one? I wonder if we should be lenient and match expressions as if they were not there (as long as types match). We already ignore them on the pattern side. See Matcher.scala#L178-L182. |
Whence the
|
Fix #8600: Match trough type ascription
Ah, #8687 is also relevant. Cool, thanks! |
The issue is described in https://users.scala-lang.org/t/implementing-map-fusion-with-dotty-macros/5791/4?u=blaisorblade — sorry for not minimizing it further. Basically, the match in
fails to match against
Mapped(foo, bar)
(as produced by macroSource(List(1, 2, 3)).map(x => x + 1)
). Using tasty reflection, I can make that match work by strippingTyped
andInlined
nodes.Additionally, I wanted to match against
TypeApply
by something likecase '{ Mapped[$A, $B]($iFirst, $iFn) } =>
(or using_
for$A
), but I could not find a working syntax to express that.To reproduce, check out https://github.com/Blaisorblade/dotty-map-fusion-staging-experiment.
The text was updated successfully, but these errors were encountered: