Skip to content

Commit f64ce14

Browse files
committed
Don't make superAccessors private
The previous logic made a super accessor private if it is put in a class (on behalf of a nested trait). This caused compilation from Tasty to fail, since at the point of Tasty generation the RHS of the accessor has not yet been generated (it will be generated later in resolveSuper), and therefore Unpickler concluded that the method is private and deferred, which is illegal. Making it private is anyway pointless, since the super accessor is referred to from an inner trait (that's why it was generated in the first place!) and therefore will be made non-private later on.
1 parent faa0a1b commit f64ce14

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/src/dotty/tools/dotc/transform/SuperAccessors.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ class SuperAccessors(thisPhase: DenotTransformer) {
8080
val superAcc = clazz.info.decl(superName)
8181
.suchThat(_.signature == superInfo.signature).symbol
8282
.orElse {
83-
ctx.debuglog(s"add super acc ${sym.showLocated} to $clazz")
84-
val deferredOrPrivate = if (clazz is Trait) Deferred else Private
83+
ctx.debugLog(s"add super acc ${sym.showLocated} to $clazz")
84+
val maybeDeferred = if (clazz is Trait) Deferred else EmptyFlags
8585
val acc = ctx.newSymbol(
86-
clazz, superName, Artifact | Method | deferredOrPrivate,
86+
clazz, superName, Artifact | Method | maybeDeferred,
8787
superInfo, coord = accPos).enteredAfter(thisPhase)
8888
// Diagnostic for SI-7091
8989
if (!accDefs.contains(clazz))

0 commit comments

Comments
 (0)