From 40a666b5cb4c8350f77a9f93e32b9e52a5356afc Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Fri, 4 Mar 2022 08:59:49 +0100 Subject: [PATCH] Improve documentation `underlyingArgument` Close #14510 --- library/src/scala/quoted/Quotes.scala | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/library/src/scala/quoted/Quotes.scala b/library/src/scala/quoted/Quotes.scala index a9e2db108f40..993cc9b9f533 100644 --- a/library/src/scala/quoted/Quotes.scala +++ b/library/src/scala/quoted/Quotes.scala @@ -699,10 +699,20 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching => /** TypeRepr of this term */ def tpe: TypeRepr - /** Replace Inlined nodes and InlineProxy references to underlying arguments */ + /** Replace Inlined nodes and InlineProxy references to underlying arguments. + * The resulting tree is useful for inspection of the value or content of a non-inline argument. + * + * 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. + */ def underlyingArgument: Term - /** Replace Ident nodes references to the underlying tree that defined them */ + /** Replace Ident nodes references to the underlying tree that defined them. + * The resulting tree is useful for inspection of the definition of some bindings. + * + * 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. + */ def underlying: Term /** Converts a partially applied term into a lambda expression */