Skip to content
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

ICE: assertion failed: class FileZipArchive has non-class parent: val <none> #12482

Closed
chengniansun opened this issue May 14, 2021 · 1 comment · Fixed by #14884
Closed

ICE: assertion failed: class FileZipArchive has non-class parent: val <none> #12482

chengniansun opened this issue May 14, 2021 · 1 comment · Fixed by #14884

Comments

@chengniansun
Copy link

Compiler Version

Scala compiler version 3.0.1-RC1-bin-SNAPSHOT-git-b9773d6 -- Copyright 2002-2021, LAMP/EPFL

System Information

Linux 5.4.0-66-generic x86_64 GNU/Linux

Minimized Code

package dotty.tools.io
object ZipArchive {
  FileZipArchive
}

Output (click arrow to expand)

undefined: new dotty.tools.io.ZipArchive # -1: TermRef(TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class tools)),object io),ZipArchive),<init>) at typer
exception occurred while typechecking mutant.scala
exception occurred while compiling mutant.scala
java.lang.AssertionError: assertion failed: class FileZipArchive has non-class parent: val <none> while compiling mutant.scala
Exception in thread "main" java.lang.AssertionError: assertion failed: class FileZipArchive has non-class parent: val <none>
	at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.traverse$1(SymDenotations.scala:1824)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.computeBaseData(SymDenotations.scala:1829)
	at dotty.tools.dotc.core.SymDenotations$BaseDataImpl.apply(SymDenotations.scala:2800)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.baseData(SymDenotations.scala:1800)
	at dotty.tools.dotc.core.SymDenotations$ClassDenotation.baseClasses(SymDenotations.scala:1807)
	at dotty.tools.dotc.core.NamerOps$.memberExists$1(NamerOps.scala:148)
	at dotty.tools.dotc.core.NamerOps$.addConstructorProxies$$anonfun$1(NamerOps.scala:155)
	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.core.Scopes$Scope.foreach(Scopes.scala:94)
	at dotty.tools.dotc.core.NamerOps$.addConstructorProxies(NamerOps.scala:163)
	at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readTemplate(TreeUnpickler.scala:947)
	at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readNewDef(TreeUnpickler.scala:853)
	at dotty.tools.dotc.core.tasty.TreeUnpickler$TreeReader.readIndexedDef(TreeUnpickler.scala:776)
	at dotty.tools.dotc.core.tasty.TreeUnpickler$Completer.complete(TreeUnpickler.scala:122)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:167)
	at dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:188)
	at dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:190)
	at dotty.tools.dotc.core.NamerOps$.addConstructorApplies(NamerOps.scala:103)
	at dotty.tools.dotc.core.NamerOps$$anon$1.complete(NamerOps.scala:118)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:167)
	at dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:188)
	at dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:190)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.ensureCompleted(SymDenotations.scala:369)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.flags(SymDenotations.scala:65)
	at dotty.tools.dotc.core.SymDenotations$ModuleCompleter.complete(SymDenotations.scala:2618)
	at dotty.tools.dotc.core.SymDenotations$SymDenotation.completeFrom(SymDenotations.scala:167)
	at dotty.tools.dotc.core.Denotations$Denotation.completeInfo$1(Denotations.scala:188)
	at dotty.tools.dotc.core.Denotations$Denotation.info(Denotations.scala:190)
	at dotty.tools.dotc.core.Types$TermRef.underlying(Types.scala:2596)
	at dotty.tools.dotc.core.Types$Type.widen(Types.scala:1211)
	at dotty.tools.dotc.typer.Typer.simplify(Typer.scala:2764)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2753)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2816)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2820)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2869)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2892)
	at dotty.tools.dotc.typer.Typer.typedClassDef(Typer.scala:2347)
	at dotty.tools.dotc.typer.Typer.typedTypeOrClassDef$2(Typer.scala:2676)
	at dotty.tools.dotc.typer.Typer.typedNamed$1(Typer.scala:2680)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2750)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2816)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2820)
	at dotty.tools.dotc.typer.Typer.traverse$1(Typer.scala:2842)
	at dotty.tools.dotc.typer.Typer.typedStats(Typer.scala:2892)
	at dotty.tools.dotc.typer.Typer.typedPackageDef(Typer.scala:2470)
	at dotty.tools.dotc.typer.Typer.typedUnnamed$1(Typer.scala:2721)
	at dotty.tools.dotc.typer.Typer.typedUnadapted(Typer.scala:2751)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2816)
	at dotty.tools.dotc.typer.Typer.typed(Typer.scala:2820)
	at dotty.tools.dotc.typer.Typer.typedExpr(Typer.scala:2936)
	at dotty.tools.dotc.typer.FrontEnd.liftedTree1$1(FrontEnd.scala:79)
	at dotty.tools.dotc.typer.FrontEnd.typeCheck$$anonfun$1(FrontEnd.scala:84)
	at dotty.tools.dotc.typer.FrontEnd.monitor(FrontEnd.scala:43)
	at dotty.tools.dotc.typer.FrontEnd.typeCheck(FrontEnd.scala:85)
	at dotty.tools.dotc.typer.FrontEnd.runOn$$anonfun$3(FrontEnd.scala:120)
	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.FrontEnd.runOn(FrontEnd.scala:120)
	at dotty.tools.dotc.Run.runPhases$4$$anonfun$4(Run.scala:205)
	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:1323)
	at dotty.tools.dotc.Run.runPhases$5(Run.scala:216)
	at dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:224)
	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
	at dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:67)
	at dotty.tools.dotc.Run.compileUnits(Run.scala:231)
	at dotty.tools.dotc.Run.compileSources(Run.scala:166)
	at dotty.tools.dotc.Run.compile(Run.scala:150)
	at dotty.tools.dotc.Driver.doCompile(Driver.scala:39)
	at dotty.tools.dotc.Driver.process(Driver.scala:199)
	at dotty.tools.dotc.Driver.process(Driver.scala:167)
	at dotty.tools.dotc.Driver.process(Driver.scala:179)
	at dotty.tools.dotc.Driver.main(Driver.scala:209)
	at dotty.tools.dotc.Main.main(Main.scala)
@kpbochenek
Copy link
Contributor

kpbochenek commented May 28, 2021

Same happens for zio-test:1.0.8 :/

Caused by: java.lang.AssertionError: assertion failed: module class ZioTestSpec$ has non-class parent: val <none>
        at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8)
        at dotty.tools.dotc.core.SymDenotations$ClassDenotation.traverse$1(SymDenotations.scala:1822)
        at dotty.tools.dotc.core.SymDenotations$ClassDenotation.computeBaseData(SymDenotations.scala:1827)
        at dotty.tools.dotc.core.SymDenotations$BaseDataImpl.apply(SymDenotations.scala:2794)
        at dotty.tools.dotc.core.SymDenotations$ClassDenotation.baseData(SymDenotations.scala:1798)
        at dotty.tools.dotc.core.SymDenotations$ClassDenotation.baseClasses(SymDenotations.scala:1805)
        at dotty.tools.dotc.core.NamerOps$.memberExists$1(NamerOps.scala:139)
        ....
object ZioTestSpec extends DefaultRunnableSpec {
  ...
}
-- Error: /tmp/tempSourceFile:11:27 --------------------------------------------
undefined: new zio.test.DefaultRunnableSpec # -1: TermRef(TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class zio)),object test),DefaultRunnableSpec),<init>) at readTasty
java.lang.AssertionError: assertion failed: module class ZioTestSpec$ has non-class parent: val <none> while compiling /tmp/scala3-scala3-target/com/kpbochenek/scala3/ZioTestSpec.tasty
2021-05-28 08:35:31,695 [ 674123]  ERROR - .intellij.openapi.command.impl - null
...

odersky added a commit to dotty-staging/dotty that referenced this issue Apr 8, 2022
Survive unpickling crashes when completing symbols from Tasty.
Crashes can happen in a number of circumstances, from overwritten
symbols (as in the test) to corrupted Tasty files. We should
survive them and present a regular error message.

Fixes scala#12482
michelou pushed a commit to michelou/scala3 that referenced this issue Apr 25, 2022
Survive unpickling crashes when completing symbols from Tasty.
Crashes can happen in a number of circumstances, from overwritten
symbols (as in the test) to corrupted Tasty files. We should
survive them and present a regular error message.

Fixes scala#12482
@Kordyjan Kordyjan added this to the 3.2.0 milestone Aug 1, 2023
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.

4 participants