Skip to content

Crash when trying to export the same member twice #14875

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
anatoliykmetyuk opened this issue Apr 7, 2022 · 0 comments · Fixed by #14879
Closed

Crash when trying to export the same member twice #14875

anatoliykmetyuk opened this issue Apr 7, 2022 · 0 comments · Fixed by #14879

Comments

@anatoliykmetyuk
Copy link
Contributor

Compiler version

Latest main to date, commit a5a85a28218d1a869680c33cf2dc09e1bf7be829.

Minimized code

object M {
  type B
}

export M.{B, B}

Output (click arrow to expand)

Exception in thread "main" java.lang.AssertionError: assertion failed: duplicate type B#4873; previous was type B#4872                                                                                                                                                                                      
        at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
        at dotty.tools.dotc.core.Scopes$MutableScope.enter(Scopes.scala:271)
        at dotty.tools.dotc.core.SymDenotations$ClassDenotation.enterNoReplace(SymDenotations.scala:1962)
        at dotty.tools.dotc.core.SymDenotations$ClassDenotation.enter(SymDenotations.scala:1953)
        at dotty.tools.dotc.core.Symbols$Symbol.entered(Symbols.scala:206)
        at dotty.tools.dotc.typer.Namer.dotty$tools$dotc$typer$Namer$ClassCompleter$$_$process$1$$anonfun$1(Namer.scala:1267)
        at scala.collection.immutable.List.foreach(List.scala:333)
        at dotty.tools.dotc.typer.Namer$ClassCompleter.process$1(Namer.scala:1267)
        at dotty.tools.dotc.typer.Namer$ClassCompleter.processExports(Namer.scala:1278)
        at dotty.tools.dotc.typer.Namer$ClassCompleter.completeInCreationContext(Namer.scala:1463)
        at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:808)
        at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:167)
        at dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:187)
        at dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:189)
        at dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:369)
        at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:2602)
        at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2865)
        at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2895)
        at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2960)
        at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2964)
        at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:3080)
        at dotty.tools.dotc.typer.TyperPhase.typeCheck$$anonfun$1(TyperPhase.scala:43)
        at dotty.tools.dotc.core.Phases$Phase.monitor(Phases.scala:414)
        at dotty.tools.dotc.typer.TyperPhase.typeCheck(TyperPhase.scala:50)
        at dotty.tools.dotc.typer.TyperPhase.runOn$$anonfun$3(TyperPhase.scala:84)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
        at scala.collection.immutable.List.foreach(List.scala:333)
        at dotty.tools.dotc.typer.TyperPhase.runOn(TyperPhase.scala:84)
        at dotty.tools.dotc.Run.runPhases$1$$anonfun$1(Run.scala:225)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
        at scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
        at scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1328)
        at dotty.tools.dotc.Run.runPhases$1(Run.scala:236)
        at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:244)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
        at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:68)
        at dotty.tools.dotc.Run.compileUnits(Run.scala:253)
        at dotty.tools.dotc.Run.compileSources(Run.scala:186)
        at dotty.tools.dotc.Run.compile(Run.scala:170)
        at dotty.tools.dotc.Driver.doCompile(Driver.scala:35)
        at dotty.tools.dotc.Driver.process(Driver.scala:195)
        at dotty.tools.dotc.Driver.process(Driver.scala:163)
        at dotty.tools.dotc.Driver.process(Driver.scala:175)
        at dotty.tools.dotc.Driver.main(Driver.scala:205)
        at dotty.tools.dotc.Main.main(Main.scala)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants