Skip to content

Assertion error from the compiler if no clean build done before compile (i.e. incremental build) #6665

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
j-mie6 opened this issue Jun 11, 2019 · 5 comments · Fixed by #10963

Comments

@j-mie6
Copy link

j-mie6 commented Jun 11, 2019

I'm getting this error if I don't clean build after editing a specific file in my project:

[error] java.lang.AssertionError: assertion failed: denotation module class assembler invalid in run 1. ValidFor: Period(1..56, run = 2)
[error] 	at dotty.DottyPredef$.assertFail(DottyPredef.scala:16)
[error] 	at dotty.tools.dotc.core.Denotations$SingleDenotation.updateValidity(Denotations.scala:817)
[error] 	at dotty.tools.dotc.core.Denotations$SingleDenotation.bringForward(Denotations.scala:844)
[error] 	at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:899)
[error] 	at dotty.tools.dotc.core.Symbols$Symbol.recomputeDenot(Symbols.scala:486)
[error] 	at dotty.tools.dotc.core.Symbols$Symbol.computeDenot(Symbols.scala:481)
[error] 	at dotty.tools.dotc.core.Symbols$Symbol.denot(Symbols.scala:475)
[error] 	at dotty.tools.dotc.core.SymDenotations.stillValidInOwner(SymDenotations.scala:62)
[error] 	at dotty.tools.dotc.core.Contexts$Context.stillValidInOwner(Contexts.scala:71)
[error] 	at dotty.tools.dotc.core.SymDenotations.stillValid(SymDenotations.scala:56)
[error] 	at dotty.tools.dotc.core.Contexts$Context.stillValid(Contexts.scala:71)
[error] 	at dotty.tools.dotc.core.Denotations$SingleDenotation.bringForward(Denotations.scala:844)
[error] 	at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:899)
[error] 	at dotty.tools.dotc.core.Symbols$Symbol.recomputeDenot(Symbols.scala:486)
[error] 	at dotty.tools.dotc.core.Symbols$Symbol.computeDenot(Symbols.scala:481)
[error] 	at dotty.tools.dotc.core.Symbols$Symbol.denot(Symbols.scala:475)
[error] 	at dotty.tools.dotc.core.SymDenotations.stillValidInOwner(SymDenotations.scala:62)
[error] 	at dotty.tools.dotc.core.Contexts$Context.stillValidInOwner(Contexts.scala:71)
[error] 	at dotty.tools.dotc.core.SymDenotations.stillValid(SymDenotations.scala:56)
[error] 	at dotty.tools.dotc.core.Contexts$Context.stillValid(Contexts.scala:71)
[error] 	at dotty.tools.dotc.core.Denotations$SingleDenotation.bringForward(Denotations.scala:844)
[error] 	at dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:899)
[error] 	at dotty.tools.dotc.core.Symbols$Symbol.recomputeDenot(Symbols.scala:486)
[error] 	at dotty.tools.dotc.core.Symbols$Symbol.computeDenot(Symbols.scala:481)
[error] 	at dotty.tools.dotc.core.Symbols$Symbol.denot(Symbols.scala:475)
[error] 	at dotty.tools.dotc.core.Symbols$.toDenot(Symbols.scala:827)
[error] 	at dotty.tools.dotc.core.MergeError.showSymbol(TypeErrors.scala:170)
[error] 	at dotty.tools.dotc.core.MergeError.toMessage(TypeErrors.scala:191)
[error] 	at dotty.tools.dotc.Driver.doCompile(Driver.scala:42)
[error] 	at dotty.tools.dotc.Driver.process(Driver.scala:172)
[error] 	at dotty.tools.dotc.Main.process(Main.scala)
[error] 	at xsbt.CachedCompilerImpl.run(CachedCompilerImpl.java:69)
[error] 	at xsbt.CompilerInterface.run(CompilerInterface.java:41)
[error] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[error] 	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[error] 	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[error] 	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
[error] 	at sbt.internal.inc.AnalyzingCompiler.call(AnalyzingCompiler.scala:237)
[error] 	at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:111)
[error] 	at sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:90)
[error] 	at sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$3(MixedAnalyzingCompiler.scala:82)
[error] 	at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
[error] 	at sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:133)
[error] 	at sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:73)
[error] 	at sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:116)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:307)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:307)
[error] 	at sbt.internal.inc.Incremental$.doCompile(Incremental.scala:106)
[error] 	at sbt.internal.inc.Incremental$.$anonfun$compile$4(Incremental.scala:87)
[error] 	at sbt.internal.inc.IncrementalCommon.recompileClasses(IncrementalCommon.scala:116)
[error] 	at sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:63)
[error] 	at sbt.internal.inc.Incremental$.$anonfun$compile$3(Incremental.scala:89)
[error] 	at sbt.internal.inc.Incremental$.manageClassfiles(Incremental.scala:134)
[error] 	at sbt.internal.inc.Incremental$.compile(Incremental.scala:80)
[error] 	at sbt.internal.inc.IncrementalCompile$.apply(Compile.scala:67)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:311)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:269)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:159)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:238)
[error] 	at sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:69)
[error] 	at sbt.Defaults$.compileIncrementalTaskImpl(Defaults.scala:1549)
[error] 	at sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:1523)
[error] 	at scala.Function1.$anonfun$compose$1(Function1.scala:44)
[error] 	at sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:40)
[error] 	at sbt.std.Transform$$anon$4.work(System.scala:67)
[error] 	at sbt.Execute.$anonfun$submit$2(Execute.scala:269)
[error] 	at sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:16)
[error] 	at sbt.Execute.work(Execute.scala:278)
[error] 	at sbt.Execute.$anonfun$submit$1(Execute.scala:269)
[error] 	at sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:178)
[error] 	at sbt.CompletionService$$anon$2.call(CompletionService.scala:37)
[error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] 	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
[error] 	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
[error] 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
[error] 	at java.base/java.lang.Thread.run(Thread.java:834)
[error] (Compile / compileIncremental) java.lang.AssertionError: assertion failed: denotation module class assembler invalid in run 1. ValidFor: Period(1..56, run = 2)

Clean compiling fixes the problem. I do not need to clean build if changing any other file, just this specific one. The files makes use of the new trait parameters (with default parameters) and extending multiple of them in each class. There are other things in the file, but they were verbatim taken from the build with Scala 2.12.

@newca12
Copy link
Contributor

newca12 commented Jun 11, 2019

This issue and #6643 are probably related (similar stack trace)

@smarter
Copy link
Member

smarter commented Jun 11, 2019

@j-mie6 Could you link to a github project where the problem can be reproduced, with the exact steps needed to reproduce it ?

@j-mie6
Copy link
Author

j-mie6 commented Jun 12, 2019

Looks like it is something to do with implicit functions, traits, multiple files and who knows what else!
minimal-bug.zip

In order to reproduce, do the following:

bash> sbt
sbt> ;clean;compile

Then edit Bad.scala by introducing a space or something, and finally:

sbt> compile

@newca12
Copy link
Contributor

newca12 commented Jun 12, 2019

FWIW even simplier
dotc foo/Oops.scala and then dotc foo/Bad.scala lead to the same stack trace.
while dotc foo/Oops.scala foo/Bad.scala work just fine.

@griggt
Copy link
Contributor

griggt commented Dec 31, 2020

This seems to have been fixed by #8386.

griggt added a commit to griggt/dotty that referenced this issue Dec 31, 2020
odersky added a commit that referenced this issue Jan 2, 2021
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