@@ -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
@@ -1464,7 +1467,7 @@ object Trees {
1464
1467
* innermost enclosing call for which the inlined version is currently
1465
1468
* processed.
1466
1469
*/
1467
- protected def inlineContext (call : tpd. Tree )(using Context ): Context = ctx
1470
+ protected def inlineContext (tree : Inlined )(using Context ): Context = ctx
1468
1471
1469
1472
/** The context to use when mapping or accumulating over a tree */
1470
1473
def localCtx (tree : Tree )(using Context ): Context
@@ -1534,8 +1537,8 @@ object Trees {
1534
1537
cpy.Try (tree)(transform(block), transformSub(cases), transform(finalizer))
1535
1538
case SeqLiteral (elems, elemtpt) =>
1536
1539
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 )))
1539
1542
case TypeTree () =>
1540
1543
tree
1541
1544
case SingletonTypeTree (ref) =>
@@ -1676,8 +1679,8 @@ object Trees {
1676
1679
this (this (this (x, block), handler), finalizer)
1677
1680
case SeqLiteral (elems, elemtpt) =>
1678
1681
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 ))
1681
1684
case TypeTree () =>
1682
1685
x
1683
1686
case SingletonTypeTree (ref) =>
0 commit comments