Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Expose QuotePattern and SplicePattern AST in Quotes #23157

shagoon started this conversation in Feature Requests
Discussion options

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:

type Unapply = tpd.UnApply | tpd.QuotePattern // TODO expose QuotePattern AST in Quotes

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

* +- Tree -+- PackageClause

Is there any interest in that contribution or am I just "doing it wrong" and those exposed types are not required at all?

Regards.

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /