Skip to content

Method is both Deferred and Private with Ycheck:all #7741

Closed
@sir-wabbit

Description

@sir-wabbit

minimized code

class A {
    @native private def a: Unit
}
trait A {
    erased def i(a: Int): Int
}
trait A {
    erased val a: Int
}
Stack trace
checking testing/Test.scala after phase frontend
checking testing/Test.scala after phase inlinedPositions
checking testing/Test.scala after phase staging
checking testing/Test.scala after phase posttyper
checking testing/Test.scala after phase pickler
checking testing/Test.scala after phase reifyQuotes
checking testing/Test.scala after phase MegaPhase{firstTransform, checkReentrant, elimPackagePrefixes, cookComments, completeJavaEnums}
checking testing/Test.scala after phase MegaPhase{checkStatic, elimRepeated, expandSAMs, protectedAccessors, extmethods, cacheAliasImplicits, shortcutImplicits, byNameClosures, hoistSuperArgs, classOf, refchecks}
checking testing/Test.scala after phase MegaPhase{elimOpaque, tryCatchPatterns, patternMatcher, explicitOuter, explicitSelf, stringInterpolatorOpt, crossCast}
checking testing/Test.scala after phase MegaPhase{pruneErasedDefs, vcInlineMethods, seqLiterals, intercepted, getters, elimByName, collectNullableFields, elimOuterSelect, augmentScala2Traits, resolveSuper, functionXXLForwarders, genericTuples, arrayConstructors}
exception while typing [cannot display due to assertion failed: getter a is both Deferred and Private, raw string = TypeDef(A,Template(DefDef(<init>,List(),List(List()),TypeTree[TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Unit)],EmptyTree),List(TypeTree[TypeRef(ThisType(TypeRef(NoPrefix,module class lang)),class Object)]),ValDef(_,EmptyTree,EmptyTree),List(DefDef(a,List(),List(),TypeTree[TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class <root>)),module scala),class Int)],EmptyTree))))] of class class dotty.tools.dotc.ast.Trees$TypeDef # 1142
exception while typing [cannot display due to assertion failed: getter a is both Deferred and Private, raw string = PackageDef(Ident(<empty>),List(TypeDef(A,Template(DefDef(<init>,List(),List(List()),TypeTree[TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Unit)],EmptyTree),List(TypeTree[TypeRef(ThisType(TypeRef(NoPrefix,module class lang)),class Object)]),ValDef(_,EmptyTree,EmptyTree),List(DefDef(a,List(),List(),TypeTree[TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class <root>)),module scala),class Int)],EmptyTree))))))] of class class dotty.tools.dotc.ast.Trees$PackageDef # 1143
exception occurred while compiling testing/Test.scala
java.lang.AssertionError: assertion failed: getter a is both Deferred and Private while compiling testing/Test.scala
Exception in thread "main" java.lang.AssertionError: assertion failed: getter a is both Deferred and Private
	at dotty.DottyPredef$.assertFail(DottyPredef.scala:17)
	at dotty.tools.dotc.transform.TreeChecker.transformSym(TreeChecker.scala:81)
	at dotty.tools.dotc.core.DenotTransformers$SymTransformer.transform(DenotTransformers.scala:70)
	at dotty.tools.dotc.transform.TreeChecker.transform(TreeChecker.scala:38)
	at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:945)
	at dotty.tools.dotc.core.Symbols$Symbol.recomputeDenot(Symbols.scala:486)
	at dotty.tools.dotc.core.Symbols$Symbol.computeDenot(Symbols.scala:481)
	at dotty.tools.dotc.core.Symbols$Symbol.denot(Symbols.scala:475)
	at dotty.tools.dotc.core.Symbols$.toDenot(Symbols.scala:847)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.paramAccessors$$anonfun$1(SymDenotations.scala:2049)
	at dotty.tools.dotc.core.Scopes$Scope.filter(Scopes.scala:102)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.paramAccessors(SymDenotations.scala:2049)
	at dotty.tools.dotc.core.Contexts$Context.superCallContext(Contexts.scala:371)
	at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:1686)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2089)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2156)
	at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:123)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2193)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2205)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2232)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2276)
	at dotty.tools.dotc.transform.Erasure$Typer.typedStats(Erasure.scala:747)
	at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:1890)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2130)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2157)
	at dotty.tools.dotc.typer.ReTyper.typedUnadapted(ReTyper.scala:123)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2193)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2205)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2290)
	at dotty.tools.dotc.transform.Erasure.run(Erasure.scala:100)
	at dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:315)
	at scala.collection.immutable.List.map(List.scala:219)
	at dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:316)
	at dotty.tools.dotc.Run.runPhases$4$$anonfun$4(Run.scala:161)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1323)
	at dotty.tools.dotc.Run.runPhases$5(Run.scala:171)
	at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:179)
	at dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
	at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:65)
	at dotty.tools.dotc.Run.compileUnits(Run.scala:186)
	at dotty.tools.dotc.Run.compileSources(Run.scala:123)
	at dotty.tools.dotc.Run.compile(Run.scala:106)
	at dotty.tools.dotc.Driver.doCompile(Driver.scala:36)
	at dotty.tools.dotc.Driver.process(Driver.scala:189)
	at dotty.tools.dotc.Driver.process(Driver.scala:158)
	at dotty.tools.dotc.Driver.process(Driver.scala:170)
	at dotty.tools.dotc.Driver.main(Driver.scala:197)
	at dotty.tools.dotc.Main.main(Main.scala)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions