File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
compiler/src/dotty/tools/dotc Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -170,9 +170,9 @@ object Inlines:
170
170
tree2
171
171
end inlineCall
172
172
173
- def inlineParentTrait (parent : tpd.Tree , childOverrideDecls : Set [Symbol ])(using Context ): List [Tree ] =
173
+ def inlineParentTrait (parent : tpd.Tree , overriddenDecls : Set [Symbol ])(using Context ): List [Tree ] =
174
174
val traitSym = if parent.symbol.isConstructor then parent.symbol.owner else parent.symbol
175
- if traitSym.isInlineTrait then InlineParentTrait (parent, traitSym.asClass, childOverrideDecls ).expandDefs()
175
+ if traitSym.isInlineTrait then InlineParentTrait (parent, traitSym.asClass, overriddenDecls ).expandDefs()
176
176
else Nil
177
177
178
178
/** Try to inline a pattern with an inline unapply method. Fail with error if the maximal
@@ -503,7 +503,7 @@ object Inlines:
503
503
allParams(info).flatten.zip(allArgs(parent).reverse.flatten).toMap
504
504
505
505
private def isStatAlreadyOverridden (stat : Tree ): Boolean =
506
- overriddenDecls.flatMap(_.allOverriddenSymbols).toSet. contains(stat.symbol)
506
+ overriddenDecls.contains(stat.symbol)
507
507
508
508
private def expandStat (stat : tpd.Tree , inlinedSym : Symbol ): tpd.Tree = stat match
509
509
case stat : ValDef if stat.symbol.is(ParamAccessor ) =>
Original file line number Diff line number Diff line change @@ -2657,8 +2657,8 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
2657
2657
if ctx.isAfterTyper then
2658
2658
Nil
2659
2659
else
2660
- val clsDecls = cls.info.decls.toList.toSet
2661
- parents1.flatMap(parent => Inlines .inlineParentTrait(parent, clsDecls ))
2660
+ val overriddenSyms = cls.info.decls.toList.flatMap(_.allOverriddenSymbols) .toSet
2661
+ parents1.flatMap(parent => Inlines .inlineParentTrait(parent, overriddenSyms ))
2662
2662
val body1 = addAccessorDefs(cls, typedStats(impl.body, dummy)(using ctx.inClassContext(self1.symbol))._1) ::: inlineTraitDefs
2663
2663
2664
2664
if ! ctx.isAfterTyper && cls.isInlineTrait then
You can’t perform that action at this time.
0 commit comments