Scala 3 Macros: Allow dynamic amount of case's in match #17889
Replies: 0 comments 4 replies
-
The main difficulty is that you'd have to come up with a type system for this. I don't think anyone has the resources to do that at the moment, so a fully fleshed-out design proposal would have to be made. |
Beta Was this translation helpful? Give feedback.
-
You mean since In that case my suggestion is to improve on the TASTy Reflect documentation, which I assume is planned anyway. I'm blown away by the capabilities when it comes to analyzing syntax trees, but when it comes to construction of them, I'm struggling at the moment as the documentation is basically non-existent (aside from the minimal generated API documentation). As example: Trying to do the above in TASTy Reflect, I reverse engineered a quoted expression, but I found no way of constructing a |
Beta Was this translation helpful? Give feedback.
-
Yes, since the
I agree, I also had some trouble finding how to do things through the current seemingly-incomplete and under-documented API. |
Beta Was this translation helpful? Give feedback.
-
I think we can close this issue. A quick search didn't reveal any other issues to improve on the TASTy Reflect API documentation, so it is probably a good idea to open a separate issue as reminder. Is this repository or the main repository a better place for that? |
Beta Was this translation helpful? Give feedback.
-
Something like this doesn't seem possible at the moment:
I expect this to be a common pattern occurring in macros, thus the feature request.
I'm also fine with using TASTy Reflect if this proves too difficult to implement. But for that I would welcome some documentation and examples for AST creation. I spent half a day trying to do this with TASTy Reflect to no avail, combing through the API documentation, dotty source code and dotty tests.
Beta Was this translation helpful? Give feedback.
All reactions