Expose QuotePattern and SplicePattern AST in Quotes #23157
shagoon
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
While playing around with a macro to automatically derive FromExpr[T] and ToExpr[T], I found no way to programmatically create QuotePattern and SplicePattern through the Quotes-API. (QuotePattern and SplicePattern appeared in inspected code of a manually written implementation for a concrete FromExpr[T] and I want to create an AST as close as possible to that in the macro.)
After digging around in scala's source code, I found that those are currently not exposed through the Quotes-API but are left as an open TODO, i.e. here:
scala3/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala
Line 1592 in 605081b
I would like to contribute that missing implementation. As far as I understand the code, I need to add those two types to Quotes as well as a module for those types. A good starting point for me would be to know the supertypes of QuotePattern and SplicePattern, i.e. where they would appear below
scala3/library/src/scala/quoted/Quotes.scala
Line 131 in 605081b
Is there any interest in that contribution or am I just "doing it wrong" and those exposed types are not required at all?
Regards.
Beta Was this translation helpful? Give feedback.
All reactions