File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
compiler/src/dotty/tools/dotc/inlines Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,11 @@ object Inlines:
45
45
else
46
46
EmptyTree
47
47
48
+ def defsToInline (traitSym : SymDenotation )(using Context ): List [Tree ] =
49
+ bodyToInline(traitSym) match
50
+ case Block (defs, _) if traitSym.isInlineTrait => defs
51
+ case _ => Nil
52
+
48
53
/** Are we in an inline method body? */
49
54
def inInlineMethod (using Context ): Boolean =
50
55
ctx.owner.ownersIterator.exists(_.isInlineMethod)
@@ -474,10 +479,9 @@ object Inlines:
474
479
private val thisInlineTrait = ThisType .raw(TypeRef (ctx.owner.prefix, ctx.owner))
475
480
476
481
def expandDefs (): List [Tree ] =
477
- val tpd .Block (stats, _) = Inlines .bodyToInline(parentSym): @ unchecked
478
- val stats1 = stats.filterNot(isStatAlreadyOverridden)
479
- val inlinedSymbols = stats1.map(stat => inlinedMember(stat.symbol))
480
- stats1.zip(inlinedSymbols).map(expandStat)
482
+ val stats = Inlines .defsToInline(parentSym).filterNot(isStatAlreadyOverridden)
483
+ val inlinedSymbols = stats.map(stat => inlinedMember(stat.symbol))
484
+ stats.zip(inlinedSymbols).map(expandStat)
481
485
end expandDefs
482
486
483
487
protected class InlineTraitTypeMap extends InlinerTypeMap {
You can’t perform that action at this time.
0 commit comments