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

"assertion failed: ClassBType.info not yet assigned" while upgrading from 2.12.7 to 2.12.8 #11716

Open
gabro opened this issue Aug 29, 2019 · 2 comments

Comments

@gabro
Copy link

commented Aug 29, 2019

I'm hitting on

[error] Error while emitting Boot.scala
[error] <error> (of class scala.reflect.internal.Types$ErrorType$)
[error] Error while emitting Boot.scala
[error] assertion failed: ClassBType.info not yet assigned: <redacted>/Boot$$anon$22$$anonfun$13;

while upgrading a project from 2.12.7 to 2.12.8 (I've verified it happens also on 2.12.9)

I've already seen #11205, #11247, #11524, and #11022 but they don't seem related.

Some more info:

  • I'm using JDK 1.8.0_192
  • If I replace the offending file (Boot.scala) with a dummy main function it compiles. If I then restore the original file and I incrementally compile, it works. Cleaning and recompiling from scratch breaks it again.
  • These are my compiler options:
sbt:api> show <redacted>/scalacOptions
[info] * -encoding
[info] * utf8
[info] * -deprecation
[info] * -feature
[info] * -unchecked
[info] * -Xlint
[info] * -language:higherKinds
[info] * -language:implicitConversions
[info] * -Ywarn-dead-code
[info] * -Ywarn-numeric-widen
[info] * -Ywarn-value-discard
[info] * -Ywarn-unused
[info] * -Ywarn-unused-import
[info] * -Yrangepos
[info] * -opt-warnings
[info] * -Ypartial-unification
[info] * -Xfuture
  • compiling with -Ydebug shows these warnings right before the final error
Stack trace

...

[warn] scala.reflect.internal.SymbolTable.$anonfun$devWarningDumpStack$1(SymbolTable.scala:109)
[warn]   at scala.tools.nsc.Global.devWarning(Global.scala:299)
[warn]   at scala.reflect.internal.Symbols$NoSymbol.owner(Symbols.scala:3598)
[warn]   at scala.tools.nsc.transform.CleanUp$CleanUpTransformer.transform(CleanUp.scala:426)
[warn]   at scala.tools.nsc.transform.CleanUp$CleanUpTransformer.transform(CleanUp.scala:37)
[warn]   at scala.reflect.internal.Trees.$anonfun$itransform$1(Trees.scala:1395)
[warn]   at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2608)
[warn]   at scala.reflect.internal.Trees.itransform(Trees.scala:1394)
[warn]   at scala.reflect.internal.Trees.itransform$(Trees.scala:1374)
[warn]   at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:28)
[warn]   at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:28)
[warn]   at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2563)
[warn]   at scala.tools.nsc.transform.CleanUp$CleanUpTransformer.transform(CleanUp.scala:502)
[warn]   at scala.tools.nsc.transform.CleanUp$CleanUpTransformer.transform(CleanUp.scala:37)
[warn]   at scala.reflect.api.Trees$Transformer.$anonfun$transformStats$1(Trees.scala:2597)
[warn] !!! NoSymbol.owner
[warn] scala.reflect.internal.SymbolTable.$anonfun$devWarningDumpStack$1(SymbolTable.scala:109)
[warn]   at scala.tools.nsc.Global.devWarning(Global.scala:299)
[warn]   at scala.reflect.internal.Symbols$NoSymbol.owner(Symbols.scala:3598)
[warn]   at scala.tools.nsc.transform.CleanUp$CleanUpTransformer.transform(CleanUp.scala:426)
[warn]   at scala.tools.nsc.transform.CleanUp$CleanUpTransformer.transform(CleanUp.scala:37)
[warn]   at scala.reflect.internal.Trees.$anonfun$itransform$1(Trees.scala:1395)
[warn]   at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2608)
[warn]   at scala.reflect.internal.Trees.itransform(Trees.scala:1394)
[warn]   at scala.reflect.internal.Trees.itransform$(Trees.scala:1374)
[warn]   at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:28)
[warn]   at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:28)
[warn]   at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2563)
[warn]   at scala.tools.nsc.transform.CleanUp$CleanUpTransformer.transform(CleanUp.scala:502)
[warn]   at scala.tools.nsc.transform.CleanUp$CleanUpTransformer.transform(CleanUp.scala:37)
[warn]   at scala.reflect.api.Trees$Transformer.$anonfun$transformStats$1(Trees.scala:2597)
[info] [running phase delambdafy on 21 compilation units]
[info] [running phase jvm on 21 compilation units]
[warn] an unexpected type representation reached the compiler backend while compiling Boot.scala: <error>. If possible, please file a bug on https://github.com/scala/bug/issues.
        at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
        at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
        at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
java.lang.AssertionError: assertion failed: ClassBType.info not yet assigned: <redacted>/Boot$$anon$22$$anonfun$13;
[error] Error while emitting Boot.scala
[error] <error> (of class scala.reflect.internal.Types$ErrorType$)
        at scala.tools.nsc.backend.jvm.BTypes$ClassBType.info(BTypes.scala:639)
        at scala.tools.nsc.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.initJClass(BCodeSkelBuilder.scala:131)
        at scala.tools.nsc.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.genPlainClass(BCodeSkelBuilder.scala:100)
        at scala.tools.nsc.backend.jvm.CodeGen.genClass(CodeGen.scala:81)
        at scala.tools.nsc.backend.jvm.CodeGen.genClassDef$1(CodeGen.scala:42)
        at scala.tools.nsc.backend.jvm.CodeGen.$anonfun$genUnit$3(CodeGen.scala:66)
        at scala.tools.nsc.backend.jvm.CodeGen.genClassDefs$1(CodeGen.scala:66)
        at scala.tools.nsc.backend.jvm.CodeGen.$anonfun$genUnit$2(CodeGen.scala:65)
        at scala.tools.nsc.backend.jvm.CodeGen.genClassDefs$1(CodeGen.scala:65)
        at scala.tools.nsc.backend.jvm.CodeGen.$anonfun$genUnit$2(CodeGen.scala:65)
        at scala.tools.nsc.backend.jvm.CodeGen.genClassDefs$1(CodeGen.scala:65)
        at scala.tools.nsc.backend.jvm.CodeGen.$anonfun$genUnit$4(CodeGen.scala:70)
        at scala.tools.nsc.backend.jvm.CodeGen.genUnit(CodeGen.scala:70)
        at scala.tools.nsc.backend.jvm.GenBCode$BCodePhase.apply(GenBCode.scala:74)
        at scala.tools.nsc.Global$GlobalPhase.applyPhase(Global.scala:453)
        at scala.tools.nsc.Global$GlobalPhase.run(Global.scala:399)
        at scala.tools.nsc.backend.jvm.GenBCode$BCodePhase.super$run(GenBCode.scala:80)
        at scala.tools.nsc.backend.jvm.GenBCode$BCodePhase.$anonfun$run$1(GenBCode.scala:80)
        at scala.tools.nsc.backend.jvm.GenBCode$BCodePhase.run(GenBCode.scala:78)
        at scala.tools.nsc.Global$Run.compileUnitsInternal(Global.scala:1503)
        at scala.tools.nsc.Global$Run.compileUnits(Global.scala:1487)
        at scala.tools.nsc.Global$Run.compileSources(Global.scala:1480)
        at scala.tools.nsc.Global$Run.compile(Global.scala:1606)
        at xsbt.CachedCompiler0.run(CompilerInterface.scala:130)
        at xsbt.CachedCompiler0.run(CompilerInterface.scala:105)
        at xsbt.CompilerInterface.run(CompilerInterface.scala:31)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at sbt.internal.inc.AnalyzingCompiler.call(AnalyzingCompiler.scala:237)
        at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:111)
        at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:90)
        at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$3(MixedAnalyzingCompiler.scala:82)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
        at sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:133)
        at sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:73)
        at sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:116)
        at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:307)
        at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:307)
        at sbt.internal.inc.Incremental$.doCompile(Incremental.scala:106)
        at sbt.internal.inc.Incremental$.$anonfun$compile$4(Incremental.scala:87)
        at sbt.internal.inc.IncrementalCommon.recompileClasses(IncrementalCommon.scala:116)
        at sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:63)
        at sbt.internal.inc.Incremental$.$anonfun$compile$3(Incremental.scala:89)
        at sbt.internal.inc.Incremental$.manageClassfiles(Incremental.scala:134)
        at sbt.internal.inc.Incremental$.compile(Incremental.scala:80)
        at sbt.internal.inc.IncrementalCompile$.apply(Compile.scala:67)
        at sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:311)
        at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:269)
        at sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:159)
        at sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:238)
        at sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:69)
        at sbt.Defaults$.compileIncrementalTaskImpl(Defaults.scala:1549)
        at sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:1523)
        at scala.Function1.$anonfun$compose$1(Function1.scala:44)
        at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
        at sbt.std.Transform$$anon$4.work(System.scala:67)
        at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
        at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
        at sbt.Execute.work(Execute.scala:278)
        at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
        at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
        at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
[error] Error while emitting Boot.scala
[error] assertion failed: ClassBType.info not yet assigned: <redacted>/Boot$$anon$22$$anonfun$13;

Unfortunately, this is a private work project and I haven't been able to minimize this bug. Actually, there are two other extremely projects which an almost identical structure and their own Boot.scala which compile just fine.

Any idea of it what it could be causing this and/or possible workarounds?

@lrytz

This comment has been minimized.

Copy link
Member

commented Aug 29, 2019

It's hard to guess.. Does the stack log (NoSymbol.owner) also show up in 2.12.7 under -Ydebug?

@gabro

This comment has been minimized.

Copy link
Author

commented Aug 30, 2019

Hi @lrytz, thanks for answering. Yes, I've just tried and they also show up in 2.12.7:

Stack trace

...
[warn] !!! NoSymbol.owner
[warn] scala.reflect.internal.SymbolTable.$anonfun$devWarningDumpStack$1(SymbolTable.scala:88)
[warn]   at scala.tools.nsc.Global.devWarning(Global.scala:292)
[warn]   at scala.reflect.internal.Symbols$NoSymbol.owner(Symbols.scala:3596)
[warn]   at scala.tools.nsc.transform.CleanUp$CleanUpTransformer.transform(CleanUp.scala:418)
[warn]   at scala.tools.nsc.transform.CleanUp$CleanUpTransformer.transform(CleanUp.scala:30)
[warn]   at scala.reflect.internal.Trees.$anonfun$itransform$1(Trees.scala:1383)
[warn]   at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2600)
[warn]   at scala.reflect.internal.Trees.itransform(Trees.scala:1382)
[warn]   at scala.reflect.internal.Trees.itransform$(Trees.scala:1362)
[warn]   at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:18)
[warn]   at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:18)
[warn]   at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2555)
[warn]   at scala.tools.nsc.transform.CleanUp$CleanUpTransformer.transform(CleanUp.scala:494)
[warn]   at scala.tools.nsc.transform.CleanUp$CleanUpTransformer.transform(CleanUp.scala:30)
[warn]   at scala.reflect.api.Trees$Transformer.$anonfun$transformStats$1(Trees.scala:2589)
[warn] !!! NoSymbol.owner
[warn] scala.reflect.internal.SymbolTable.$anonfun$devWarningDumpStack$1(SymbolTable.scala:88)
[warn]   at scala.tools.nsc.Global.devWarning(Global.scala:292)
[warn]   at scala.reflect.internal.Symbols$NoSymbol.owner(Symbols.scala:3596)
[warn]   at scala.tools.nsc.transform.CleanUp$CleanUpTransformer.transform(CleanUp.scala:418)
[warn]   at scala.tools.nsc.transform.CleanUp$CleanUpTransformer.transform(CleanUp.scala:30)
[warn]   at scala.reflect.internal.Trees.$anonfun$itransform$1(Trees.scala:1383)
[warn]   at scala.reflect.api.Trees$Transformer.atOwner(Trees.scala:2600)
[warn]   at scala.reflect.internal.Trees.itransform(Trees.scala:1382)
[warn]   at scala.reflect.internal.Trees.itransform$(Trees.scala:1362)
[warn]   at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:18)
[warn]   at scala.reflect.internal.SymbolTable.itransform(SymbolTable.scala:18)
[warn]   at scala.reflect.api.Trees$Transformer.transform(Trees.scala:2555)
[warn]   at scala.tools.nsc.transform.CleanUp$CleanUpTransformer.transform(CleanUp.scala:494)
[warn]   at scala.tools.nsc.transform.CleanUp$CleanUpTransformer.transform(CleanUp.scala:30)
[warn]   at scala.reflect.api.Trees$Transformer.$anonfun$transformStats$1(Trees.scala:2589)
[info] [running phase delambdafy on 21 compilation units]
[info] [running phase jvm on 21 compilation units]
[info] [running phase xsbt-analyzer on 21 compilation units]
[warn] 237 warnings found
[info] Done compiling.
[success] Total time: 46 s, completed Aug 30, 2019 10:56:53 AM
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.