Closed
Description
package a {
class PolyA {
protected def m(): Unit = ()
}
}
class X extends a.PolyA {
trait Inner {
m()
}
}
which can be reproduced with
dotc -d out <sourceAbove>
dotc -from-tasty -Ycheck:elimJavaPackages,refchecks,splitter,arrayConstructors,erasure,capturedVars,getClass,elimStaticThis,labelDef -classpath out X a.PolyA
and fails with
checking out2/a/PolyA.class after phase MegaPhase{checkStatic, elimRepeated, normalizeFlags, extmethods, expandSAMs, tailrec, byNameClosures, liftTry, hoistSuperArgs, classOf, refchecks}
Exception in thread "main" java.lang.AssertionError: assertion failed: method super$m is both Deferred and Private
at scala.Predef$.assert(Predef.scala:219)
at dotty.tools.dotc.transform.TreeChecker.transformSym(TreeChecker.scala:95)
at dotty.tools.dotc.core.DenotTransformers$SymTransformer.transform(DenotTransformers.scala:68)
at dotty.tools.dotc.core.DenotTransformers$SymTransformer.transform$(DenotTransformers.scala:67)
at dotty.tools.dotc.transform.TreeChecker.transform(TreeChecker.scala:48)
at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:872)
at dotty.tools.dotc.core.Symbols$Symbol.recomputeDenot(Symbols.scala:432)
at dotty.tools.dotc.core.Symbols$Symbol.computeDenot(Symbols.scala:427)
at dotty.tools.dotc.core.Symbols$Symbol.denot(Symbols.scala:421)
at dotty.tools.dotc.core.Symbols$.toDenot(Symbols.scala:684)
at dotty.tools.dotc.core.SymDenotations$ClassDenotation.$anonfun$paramAccessors$1(SymDenotations.scala:1765)
at dotty.tools.dotc.core.SymDenotations$ClassDenotation.$anonfun$paramAccessors$1$adapted(SymDenotations.scala:1765)
at dotty.tools.dotc.core.Scopes$Scope.filter(Scopes.scala:104)
at dotty.tools.dotc.core.SymDenotations$ClassDenotation.paramAccessors(SymDenotations.scala:1765)
at dotty.tools.dotc.core.Contexts$Context.superCallContext(Contexts.scala:328)
...