Skip to content

AssertionError: duplicate type when exporting conflicting type members #8333

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
panacekcz opened this issue Feb 17, 2020 · 0 comments · Fixed by #8341
Closed

AssertionError: duplicate type when exporting conflicting type members #8333

panacekcz opened this issue Feb 17, 2020 · 0 comments · Fixed by #8341

Comments

@panacekcz
Copy link
Contributor

minimized code

class A{
  type T = Int // can also be class T
}
class B(x: A, y: A){
  export x._
  export y._
}

Crash output (click arrow to expand)

exception occurred while typechecking export-type-conflict.scala
exception occurred while compiling export-type-conflict.scala
java.lang.AssertionError: assertion failed: duplicate type T#3901; previous was type T#3900 while compiling export-type-conflict.scala
Exception in thread "main" java.lang.AssertionError: assertion failed: duplicate type T#3901; previous was type T#3900
	at dotty.DottyPredef$.assertFail(DottyPredef.scala:17)
	at dotty.tools.dotc.core.Scopes$MutableScope.enter(Scopes.scala:269)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.enterNoReplace(SymDenotations.scala:1763)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.enter(SymDenotations.scala:1752)
	at dotty.tools.dotc.core.Symbols$Symbol.entered(Symbols.scala:571)
	at dotty.tools.dotc.typer.Namer.processExports$$anonfun$2$$anonfun$1(Namer.scala:1151)
	at scala.collection.immutable.List.foreach(List.scala:305)
	at dotty.tools.dotc.typer.Namer.dotty$tools$dotc$typer$Namer$ClassCompleter$$_$processExports$$anonfun$1(Namer.scala:1151)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at scala.collection.immutable.List.foreach(List.scala:305)
	at dotty.tools.dotc.typer.Namer$ClassCompleter.processExports(Namer.scala:1151)
	at dotty.tools.dotc.typer.Namer$ClassCompleter.completeInCreationContext(Namer.scala:1291)
	at dotty.tools.dotc.typer.Namer$Completer.complete(Namer.scala:840)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:260)
	at dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:185)
	at dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:187)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:400)
	at dotty.tools.dotc.typer.Typer.retrieveSym(Typer.scala:2118)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2143)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2223)
	at dotty.tools.dotc.typer.Typer.op$1(Typer.scala:2262)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2271)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2274)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2296)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2340)
	at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:1959)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2197)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2224)
	at dotty.tools.dotc.typer.Typer.op$1(Typer.scala:2262)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2271)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2274)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2382)
	at dotty.tools.dotc.typer.FrontEnd.liftedTree1$2(FrontEnd.scala:78)
	at dotty.tools.dotc.typer.FrontEnd.typeCheck$$anonfun$1(FrontEnd.scala:83)
	at dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
	at dotty.tools.dotc.typer.FrontEnd.monitor(FrontEnd.scala:42)
	at dotty.tools.dotc.typer.FrontEnd.typeCheck(FrontEnd.scala:84)
	at dotty.tools.dotc.typer.FrontEnd.runOn$$anonfun$3(FrontEnd.scala:114)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:15)
	at dotty.runtime.function.JProcedure1.apply(JProcedure1.java:10)
	at scala.collection.immutable.List.foreach(List.scala:305)
	at dotty.tools.dotc.typer.FrontEnd.runOn(FrontEnd.scala:114)
	at dotty.tools.dotc.Run.runPhases$4$$anonfun$4(Run.scala:167)
	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:177)
	at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:185)
	at dotty.runtime.function.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
	at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:64)
	at dotty.tools.dotc.Run.compileUnits(Run.scala:192)
	at dotty.tools.dotc.Run.compileSources(Run.scala:129)
	at dotty.tools.dotc.Run.compile(Run.scala:112)
	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)
odersky added a commit to dotty-staging/dotty that referenced this issue Feb 18, 2020
Check for duplicate symbols when  creating export forwarders.
@nicolasstucki nicolasstucki linked a pull request Feb 19, 2020 that will close this issue
smarter added a commit that referenced this issue Feb 22, 2020
Fix #8333: Check for duplicate symbols in exports
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.

1 participant