Skip to content

crash on compilable code: assertion failed: Cannot create ClassBType for phantom type Lscala/Null #1688

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
helloqirun opened this issue Nov 8, 2016 · 2 comments

Comments

@helloqirun
Copy link

scalac compiles but dotc crashes.

$ cat abc.scala

package scala
sealed trait Null

$ dotc abc.scala

java.lang.AssertionError: assertion failed: Cannot create ClassBType for phantom type Lscala/Null;
	at scala.Predef$.assert(Predef.scala:165)
	at scala.tools.nsc.backend.jvm.BTypes$ClassBType.checkInfoConsistency(BTypes.scala:620)
	at scala.tools.nsc.backend.jvm.BTypes$ClassBType.info_$eq(BTypes.scala:607)
	at scala.tools.nsc.backend.jvm.BTypesFromSymbols.scala$tools$nsc$backend$jvm$BTypesFromSymbols$$setClassInfo(BTypesFromSymbols.scala:142)
	at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$classBTypeFromSymbol$4.apply(BTypesFromSymbols.scala:63)
	at scala.tools.nsc.backend.jvm.BTypesFromSymbols$$anonfun$classBTypeFromSymbol$4.apply(BTypesFromSymbols.scala:57)
	at scala.collection.MapLike$class.getOrElse(MapLike.scala:128)
	at scala.collection.AbstractMap.getOrElse(Map.scala:59)
	at scala.tools.nsc.backend.jvm.BTypesFromSymbols.classBTypeFromSymbol(BTypesFromSymbols.scala:57)
	at scala.tools.nsc.backend.jvm.BCodeHelpers$BCInnerClassGen$class.getClassBTypeAndRegisterInnerClass(BCodeHelpers.scala:243)
<snipped>
@felixmulder
Copy link
Contributor

@helloqirun - thanks, confirmed as bug which crashes the shared backend

@DarkDimius
Copy link
Contributor

Note that this source code tries to redefine a synthetic class in scala package. I wouldn't consider this a bug but I agree that the error message should be prettier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants