@@ -673,6 +673,9 @@ object Trees {
673
673
*/
674
674
case class Inlined [+ T <: Untyped ] private [ast] (call : tpd.Tree , bindings : List [MemberDef [T ]], expansion : Tree [T ])(implicit @ constructorOnly src : SourceFile )
675
675
extends Tree [T ] {
676
+
677
+ def inlinedFromOuterScope : Boolean = call.isEmpty
678
+
676
679
type ThisTree [+ T <: Untyped ] = Inlined [T ]
677
680
override def isTerm = expansion.isTerm
678
681
override def isType = expansion.isType
@@ -1479,7 +1482,7 @@ object Trees {
1479
1482
* innermost enclosing call for which the inlined version is currently
1480
1483
* processed.
1481
1484
*/
1482
- protected def inlineContext (call : tpd. Tree )(using Context ): Context = ctx
1485
+ protected def inlineContext (tree : Inlined )(using Context ): Context = ctx
1483
1486
1484
1487
/** The context to use when mapping or accumulating over a tree */
1485
1488
def localCtx (tree : Tree )(using Context ): Context
@@ -1549,8 +1552,8 @@ object Trees {
1549
1552
cpy.Try (tree)(transform(block), transformSub(cases), transform(finalizer))
1550
1553
case SeqLiteral (elems, elemtpt) =>
1551
1554
cpy.SeqLiteral (tree)(transform(elems), transform(elemtpt))
1552
- case Inlined (call, bindings, expansion) =>
1553
- cpy.Inlined (tree)(call, transformSub(bindings), transform(expansion)(using inlineContext(call )))
1555
+ case tree @ Inlined (call, bindings, expansion) =>
1556
+ cpy.Inlined (tree)(call, transformSub(bindings), transform(expansion)(using inlineContext(tree )))
1554
1557
case TypeTree () =>
1555
1558
tree
1556
1559
case SingletonTypeTree (ref) =>
@@ -1693,8 +1696,8 @@ object Trees {
1693
1696
this (this (this (x, block), handler), finalizer)
1694
1697
case SeqLiteral (elems, elemtpt) =>
1695
1698
this (this (x, elems), elemtpt)
1696
- case Inlined (call, bindings, expansion) =>
1697
- this (this (x, bindings), expansion)(using inlineContext(call ))
1699
+ case tree @ Inlined (call, bindings, expansion) =>
1700
+ this (this (x, bindings), expansion)(using inlineContext(tree ))
1698
1701
case TypeTree () =>
1699
1702
x
1700
1703
case SingletonTypeTree (ref) =>
0 commit comments