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

What is the alternative to using underlying/underlyingArgument/matching on Inlined when generating code? #19764

Unanswered
smarter asked this question in Metaprogramming
Discussion options

The API documentation for these methods states:

Warning: This tree may contain references that are out of scope and should not be used in the generated code.
This method should only used to port Scala 2 that used to access their outer scope unsoundly.

But nothing in the API documentation or in https://dotty.epfl.ch/docs/reference/metaprogramming/reflection.html states how to handle Inlined nodes correctly. In fact https://dotty.epfl.ch/docs/reference/metaprogramming/reflection.html#extractors-2 explicitly extracts stuff from an Inlined node and doesn't say anything about safety.

Are the warnings still accurate? If so, what is the appropriate way to extract things from under an Inlined node? Is it OK if and only if the bindings field of the Inlined node is empty? When can we rely on bindings to be empty?

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 によって変換されたページ (->オリジナル) /