-
Notifications
You must be signed in to change notification settings - Fork 1.1k
What is the alternative to using underlying/underlyingArgument/matching on Inlined when generating code? #19764
-
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?
Beta Was this translation helpful? Give feedback.