-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Backend triggers assertion in assertClassNotArray #461
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
Comments
@DarkDimius : Can you try compiling the same fie twice? |
Though It doesn't actually pass Ycheck:
|
I guess I know the issue. |
OK, this appears to be very tricky to reproduce, here's a script that should help: #!/bin/sh
set -x
mv ff ff.bak
mkdir newDir
cd newDir
echo "package ff\nobject Foo {}" > po.scala
cd ..
sbt "run ./newDir/po.scala"
sbt "run ./newDir/po.scala" Put this in a file called bug.sh, then: % sh bug.sh
+ mv ff ff.bak
+ mkdir newDir
mkdir: cannot create directory ‘newDir’: File exists
+ cd newDir
+ echo package ff\nobject Foo {}
+ cd ..
+ sbt run ./newDir/po.scala
[info] Loading global plugins from /home/smarter/.sbt/0.13/plugins
[info] Loading project definition from /home/smarter/opt/dotty/project
[info] Set current project to dotty (in build file:/home/smarter/opt/dotty/)
[info] Running dotty.tools.dotc.Main ./newDir/po.scala
[success] Total time: 3 s, completed Apr 4, 2015 2:25:20 AM
+ sbt run ./newDir/po.scala
[info] Loading global plugins from /home/smarter/.sbt/0.13/plugins
[info] Loading project definition from /home/smarter/opt/dotty/project
[info] Set current project to dotty (in build file:/home/smarter/opt/dotty/)
[info] Running dotty.tools.dotc.Main ./newDir/po.scala
[error] java.lang.AssertionError: assertion failed: val <none>
[error] at scala.Predef$.assert(Predef.scala:165)
[error] at scala.tools.nsc.backend.jvm.BCodeHelpers$BCInnerClassGen$class.assertClassNotArray(BCodeHelpers.scala:214)
[error] at scala.tools.nsc.backend.jvm.BCodeHelpers$BCInnerClassGen$class.assertClassNotArrayNotPrimitive(BCodeHelpers.scala:219)
[error] at scala.tools.nsc.backend.jvm.BCodeHelpers$BCInnerClassGen$class.getClassBTypeAndRegisterInnerClass(BCodeHelpers.scala:238)
[error] at scala.tools.nsc.backend.jvm.BCodeHelpers$JCommonBuilder.getClassBTypeAndRegisterInnerClass(BCodeHelpers.scala:469)
[error] at scala.tools.nsc.backend.jvm.BCodeHelpers$BCInnerClassGen$class.internalName(BCodeHelpers.scala:210)
[error] at scala.tools.nsc.backend.jvm.BCodeHelpers$JCommonBuilder.internalName(BCodeHelpers.scala:469)
[error] at scala.tools.nsc.backend.jvm.BCodeHelpers$JMirrorBuilder.genMirrorClass(BCodeHelpers.scala:494)
[error] at dotty.tools.backend.jvm.GenBCodePipeline$Worker1.visit(GenBCode.scala:164)
[error] at dotty.tools.backend.jvm.GenBCodePipeline$Worker1.run(GenBCode.scala:126)
[error] at dotty.tools.backend.jvm.GenBCodePipeline.buildAndSendToDisk(GenBCode.scala:320)
[error] at dotty.tools.backend.jvm.GenBCodePipeline.run(GenBCode.scala:289)
[error] at dotty.tools.backend.jvm.GenBCode.run(GenBCode.scala:40)
[error] at dotty.tools.dotc.core.Phases$Phase$$anonfun$runOn$1.apply(Phases.scala:266)
[error] at dotty.tools.dotc.core.Phases$Phase$$anonfun$runOn$1.apply(Phases.scala:264)
[error] at scala.collection.immutable.List.map(List.scala:273)
[error] at dotty.tools.dotc.core.Phases$Phase$class.runOn(Phases.scala:264)
[error] at dotty.tools.backend.jvm.GenBCode.runOn(GenBCode.scala:33)
[error] at dotty.tools.dotc.Run$$anonfun$compileSources$1$$anonfun$apply$mcV$sp$3.apply(Run.scala:50)
[error] at dotty.tools.dotc.Run$$anonfun$compileSources$1$$anonfun$apply$mcV$sp$3.apply(Run.scala:47)
[error] at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33)
[error] at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186)
[error] at dotty.tools.dotc.Run$$anonfun$compileSources$1.apply$mcV$sp(Run.scala:47)
[error] at dotty.tools.dotc.Run$$anonfun$compileSources$1.apply(Run.scala:42)
[error] at dotty.tools.dotc.Run$$anonfun$compileSources$1.apply(Run.scala:42)
[error] at dotty.tools.dotc.util.Stats$.monitorHeartBeat(Stats.scala:68)
[error] at dotty.tools.dotc.Run.compileSources(Run.scala:41)
[error] at dotty.tools.dotc.Run.compile(Run.scala:32)
[error] at dotty.tools.dotc.Driver.doCompile(Driver.scala:20)
[error] at dotty.tools.dotc.Main$.doCompile(Main.scala:26)
[error] at dotty.tools.dotc.Driver.process(Driver.scala:31)
[error] at dotty.tools.dotc.Driver.main(Driver.scala:40)
[error] at dotty.tools.dotc.Main.main(Main.scala)
[error] error: Error while emitting po.scala
[error] assertion failed: val <none>
[error] one error found
java.lang.RuntimeException: Nonzero exit code returned from runner: 1
at scala.sys.package$.error(package.scala:27)
[trace] Stack trace suppressed: run last dotty/compile:run for the full output.
[error] (dotty/compile:run) Nonzero exit code returned from runner: 1
[error] Total time: 2 s, completed Apr 4, 2015 2:25:27 AM |
Was able to reproduce, after running the script in loop for around 20 times. The problem that causes backend to go wild: |
Yes, I'm not crazy then :). |
That's some kind of bug in
It could have to do with #462. @odersky, AFAIK you have made some fixes to |
Why this doesn't create a problem for travis: current test infrastructure emits classfile outputs in |
@smarter, after latest fixes for stale symbols and restoreScopes cannot reproduce anymore. |
I can't reproduce anymore either, I guess whatever fixed #462 fixed this. |
The following code:
Results in an assertion error:
A quick bisection search shows that this started happening when #436 was merged.
Assigned to @DarkDimius .
The text was updated successfully, but these errors were encountered: