@@ -673,6 +673,9 @@ object Trees {
673673 */
674674 case class Inlined [+ T <: Untyped ] private [ast] (call : tpd.Tree , bindings : List [MemberDef [T ]], expansion : Tree [T ])(implicit @ constructorOnly src : SourceFile )
675675 extends Tree [T ] {
676+
677+ def inlinedFromOuterScope : Boolean = call.isEmpty
678+
676679 type ThisTree [+ T <: Untyped ] = Inlined [T ]
677680 override def isTerm = expansion.isTerm
678681 override def isType = expansion.isType
@@ -1464,7 +1467,7 @@ object Trees {
14641467 * innermost enclosing call for which the inlined version is currently
14651468 * processed.
14661469 */
1467- protected def inlineContext (call : tpd. Tree )(using Context ): Context = ctx
1470+ protected def inlineContext (tree : Inlined )(using Context ): Context = ctx
14681471
14691472 /** The context to use when mapping or accumulating over a tree */
14701473 def localCtx (tree : Tree )(using Context ): Context
@@ -1534,8 +1537,8 @@ object Trees {
15341537 cpy.Try (tree)(transform(block), transformSub(cases), transform(finalizer))
15351538 case SeqLiteral (elems, elemtpt) =>
15361539 cpy.SeqLiteral (tree)(transform(elems), transform(elemtpt))
1537- case Inlined (call, bindings, expansion) =>
1538- cpy.Inlined (tree)(call, transformSub(bindings), transform(expansion)(using inlineContext(call )))
1540+ case tree @ Inlined (call, bindings, expansion) =>
1541+ cpy.Inlined (tree)(call, transformSub(bindings), transform(expansion)(using inlineContext(tree )))
15391542 case TypeTree () =>
15401543 tree
15411544 case SingletonTypeTree (ref) =>
@@ -1676,8 +1679,8 @@ object Trees {
16761679 this (this (this (x, block), handler), finalizer)
16771680 case SeqLiteral (elems, elemtpt) =>
16781681 this (this (x, elems), elemtpt)
1679- case Inlined (call, bindings, expansion) =>
1680- this (this (x, bindings), expansion)(using inlineContext(call ))
1682+ case tree @ Inlined (call, bindings, expansion) =>
1683+ this (this (x, bindings), expansion)(using inlineContext(tree ))
16811684 case TypeTree () =>
16821685 x
16831686 case SingletonTypeTree (ref) =>
0 commit comments