We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9fef766 commit 2811429Copy full SHA for 2811429
compiler/src/dotty/tools/dotc/transform/Mixin.scala
@@ -134,6 +134,10 @@ class Mixin extends MiniPhase with SymTransformer { thisPhase =>
134
else sym.copySymDenotation(initFlags = sym.flags &~ ParamAccessor | Deferred)
135
sym1.ensureNotPrivate
136
}
137
+ else if sym.isAllOf(ModuleClass | Private) && sym.owner.is(Trait) then
138
+ // modules in trait will be instantiated in the classes mixing in the trait; they must be made non-private
139
+ // do not use ensureNotPrivate because the `name` must not be expanded in this case
140
+ sym.copySymDenotation(initFlags = sym.flags &~ Private)
141
else if (sym.isConstructor && sym.owner.is(Trait))
142
sym.copySymDenotation(
143
name = nme.TRAIT_CONSTRUCTOR,
0 commit comments