scala / scala3

The Scala 3 compiler, also known as Dotty.
https://dotty.epfl.ch
Apache License 2.0
5.8k stars 1.04k forks source link

Scala3 crashes due to binary-incompatible upgrade when it should emit an error instead #18152

Open pmeheut opened 1 year ago

pmeheut commented 1 year ago

A project I've been working on compiles perfectly but as soon as I add "com.raquo" %%% "waypoint" % "6.0.0" to the dependencies, the compiler crashes. Even if no code is referencing the library.

Compiler version

3.3.0

Minimized code

The problem occurs in a full-stack project with Scala JVM/Scala JS cross-compilation, Caliban, ZIO, Quill and when I had a library to the dependencies in sbt. I have tried to reproduce it but it disappears if the code is too simple. If needed, I could create a repository with moke versions of the proprietary code but the problem and stack is exactly the same as https://github.com/lampepfl/dotty/issues/16439

Output (click arrow to expand)

```scala error] ## Exception when compiling 7 sources to /target/scala-3.3.0/classes [error] java.lang.AssertionError: assertion failed [error] scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:11) [error] dotty.tools.dotc.core.Types$MethodType.(Types.scala:3901) [error] dotty.tools.dotc.core.Types$CachedMethodType.(Types.scala:3921) [error] dotty.tools.dotc.core.Types$MethodTypeCompanion.apply(Types.scala:4013) [error] dotty.tools.dotc.core.Types$MethodTypeCompanion.apply(Types.scala:4012) [error] dotty.tools.dotc.core.Types$LambdaTypeCompanion.apply(Types.scala:3933) [error] dotty.tools.dotc.core.TypeErasure.eraseInfo(TypeErasure.scala:752) [error] dotty.tools.dotc.core.TypeErasure$.transformInfo(TypeErasure.scala:244) [error] dotty.tools.dotc.transform.Erasure.transform(Erasure.scala:97) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:827) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:873) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:844) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:873) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:844) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:873) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:844) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:873) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:844) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:873) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:844) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:873) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:844) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:873) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:844) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:873) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:844) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:873) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:844) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:873) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:844) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:873) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:844) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:873) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:844) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:873) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:844) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:873) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:844) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:873) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:844) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:873) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:844) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:873) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:844) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:873) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:844) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:873) [error] dotty.tools.dotc.core.Symbols$Symbol.recomputeDenot(Symbols.scala:120) [error] dotty.tools.dotc.core.Symbols$Symbol.computeDenot(Symbols.scala:114) [error] dotty.tools.dotc.core.Symbols$Symbol.denot(Symbols.scala:107) [error] dotty.tools.dotc.core.Symbols$.toDenot(Symbols.scala:494) [error] dotty.tools.dotc.transform.Mixin.needsTraitSetter(Mixin.scala:174) [error] dotty.tools.dotc.transform.Mixin.transformSym$$anonfun$1(Mixin.scala:153) [error] scala.runtime.function.JProcedure1.apply(JProcedure1.java:15) [error] scala.runtime.function.JProcedure1.apply(JProcedure1.java:10) [error] scala.collection.immutable.List.foreach(List.scala:333) [error] dotty.tools.dotc.core.Scopes$Scope.foreach(Scopes.scala:93) [error] dotty.tools.dotc.transform.Mixin.transformSym(Mixin.scala:157) [error] dotty.tools.dotc.core.DenotTransformers$SymTransformer.transform(DenotTransformers.scala:70) [error] dotty.tools.dotc.core.DenotTransformers$SymTransformer.transform$(DenotTransformers.scala:65) [error] dotty.tools.dotc.transform.Mixin.transform(Mixin.scala:113) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.goForward$1(Denotations.scala:827) [error] dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:873) [error] dotty.tools.dotc.core.Symbols$Symbol.recomputeDenot(Symbols.scala:120) [error] dotty.tools.dotc.core.Symbols$Symbol.computeDenot(Symbols.scala:114) [error] dotty.tools.dotc.core.Symbols$Symbol.denot(Symbols.scala:107) [error] dotty.tools.dotc.core.Symbols$.toDenot(Symbols.scala:494) [error] dotty.tools.dotc.transform.Dependencies.isLocal(Dependencies.scala:74) [error] dotty.tools.dotc.transform.Dependencies.process(Dependencies.scala:217) [error] dotty.tools.dotc.transform.LambdaLift$Lifter$$anon$1.process(LambdaLift.scala:41) [error] dotty.tools.dotc.transform.LambdaLift$Lifter$$anon$1.process(LambdaLift.scala:40) [error] dotty.tools.dotc.transform.Dependencies$CollectDependencies.traverse(Dependencies.scala:240) [error] dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.apply(Trees.scala:1660) [error] dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.apply(Trees.scala:1660) [error] dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.foldOver(Trees.scala:1551) [error] dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.traverseChildren(Trees.scala:1661) [error] dotty.tools.dotc.transform.Dependencies$CollectDependencies.traverse(Dependencies.scala:241) [error] dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.apply(Trees.scala:1660) [error] dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.apply(Trees.scala:1660) [error] dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.foldOver(Trees.scala:1545) [error] dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.traverseChildren(Trees.scala:1661) [error] dotty.tools.dotc.transform.Dependencies$CollectDependencies.traverse(Dependencies.scala:241) [error] dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.apply(Trees.scala:1660) [error] dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.apply(Trees.scala:1660) [error] dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.foldOver(Trees.scala:1551) [error] dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.traverseChildren(Trees.scala:1661) [error] dotty.tools.dotc.transform.Dependencies$CollectDependencies.traverse(Dependencies.scala:241) [error] dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.apply(Trees.scala:1660) [error] dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.apply(Trees.scala:1660) [error] dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.foldOver(Trees.scala:1563) [error] dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.traverseChildren(Trees.scala:1661) [error] dotty.tools.dotc.transform.Dependencies$CollectDependencies.traverse(Dependencies.scala:241) [error] dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.apply(Trees.scala:1660) [error] dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.apply(Trees.scala:1660) [error] dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.fold$1(Trees.scala:1532) [error] dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.apply(Trees.scala:1534) [error] dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.foldOver(Trees.scala:1565) [error] dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.traverseChildren(Trees.scala:1661) [error] dotty.tools.dotc.transform.Dependencies$CollectDependencies.traverse(Dependencies.scala:241) [error] dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.apply(Trees.scala:1660) [error] dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.apply(Trees.scala:1660) [error] dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.foldOver(Trees.scala:1620) [error] dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.traverseChildren(Trees.scala:1661) [error] dotty.tools.dotc.transform.Dependencies$CollectDependencies.traverse(Dependencies.scala:241) [error] dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.apply(Trees.scala:1660) [error] dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.apply(Trees.scala:1660) [error] dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.foldOver(Trees.scala:1627) [error] dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.traverseChildren(Trees.scala:1661) [error] dotty.tools.dotc.transform.Dependencies$CollectDependencies.traverse(Dependencies.scala:241) [error] dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.apply(Trees.scala:1660) [error] dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.apply(Trees.scala:1660) [error] dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.foldOver(Trees.scala:1624) [error] dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.traverseChildren(Trees.scala:1661) [error] dotty.tools.dotc.transform.Dependencies$CollectDependencies.traverse(Dependencies.scala:241) [error] dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.apply(Trees.scala:1660) [error] dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.apply(Trees.scala:1660) [error] dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.fold$1(Trees.scala:1532) [error] dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.apply(Trees.scala:1534) [error] dotty.tools.dotc.ast.Trees$Instance$TreeAccumulator.foldOver(Trees.scala:1633) [error] dotty.tools.dotc.ast.Trees$Instance$TreeTraverser.traverseChildren(Trees.scala:1661) [error] dotty.tools.dotc.transform.Dependencies$CollectDependencies.traverse(Dependencies.scala:241) [error] dotty.tools.dotc.transform.Dependencies.(Dependencies.scala:283) [error] dotty.tools.dotc.transform.LambdaLift$Lifter$$anon$1.(LambdaLift.scala:36) [error] dotty.tools.dotc.transform.LambdaLift$Lifter.(LambdaLift.scala:49) [error] dotty.tools.dotc.transform.LambdaLift.prepareForUnit(LambdaLift.scala:276) [error] dotty.tools.dotc.transform.MegaPhase.prepUnit(MegaPhase.scala:1046) [error] dotty.tools.dotc.transform.MegaPhase.transformUnit(MegaPhase.scala:453) [error] dotty.tools.dotc.transform.MegaPhase.run(MegaPhase.scala:466) [error] dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:324) [error] scala.collection.immutable.List.map(List.scala:250) [error] dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:328) [error] dotty.tools.dotc.Run.runPhases$1$$anonfun$1(Run.scala:247) [error] scala.runtime.function.JProcedure1.apply(JProcedure1.java:15) [error] scala.runtime.function.JProcedure1.apply(JProcedure1.java:10) [error] scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1321) [error] dotty.tools.dotc.Run.runPhases$1(Run.scala:263) [error] dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:271) [error] dotty.tools.dotc.Run.compileUnits$$anonfun$adapted$1(Run.scala:280) [error] dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:67) [error] dotty.tools.dotc.Run.compileUnits(Run.scala:280) [error] dotty.tools.dotc.Run.compileSources(Run.scala:195) [error] dotty.tools.dotc.Run.compile(Run.scala:179) [error] dotty.tools.dotc.Driver.doCompile(Driver.scala:35) [error] dotty.tools.xsbt.CompilerBridgeDriver.run(CompilerBridgeDriver.java:88) [error] dotty.tools.xsbt.CompilerBridge.run(CompilerBridge.java:22) [error] sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:91) [error] sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$7(MixedAnalyzingCompiler.scala:193) [error] scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) [error] sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:248) [error] sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4(MixedAnalyzingCompiler.scala:183) [error] sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4$adapted(MixedAnalyzingCompiler.scala:163) [error] sbt.internal.inc.JarUtils$.withPreviousJar(JarUtils.scala:239) [error] sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:163) [error] sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:211) [error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:534) [error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:534) [error] sbt.internal.inc.Incremental$.$anonfun$apply$5(Incremental.scala:179) [error] sbt.internal.inc.Incremental$.$anonfun$apply$5$adapted(Incremental.scala:177) [error] sbt.internal.inc.Incremental$$anon$2.run(Incremental.scala:463) [error] sbt.internal.inc.IncrementalCommon$CycleState.next(IncrementalCommon.scala:116) [error] sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:56) [error] sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:52) [error] sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:263) [error] sbt.internal.inc.Incremental$.$anonfun$incrementalCompile$8(Incremental.scala:418) [error] sbt.internal.inc.Incremental$.withClassfileManager(Incremental.scala:506) [error] sbt.internal.inc.Incremental$.incrementalCompile(Incremental.scala:405) [error] sbt.internal.inc.Incremental$.apply(Incremental.scala:171) [error] sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:534) [error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:488) [error] sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:332) [error] sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:425) [error] sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:137) [error] sbt.Defaults$.compileIncrementalTaskImpl(Defaults.scala:2363) [error] sbt.Defaults$.$anonfun$compileIncrementalTask$2(Defaults.scala:2313) [error] sbt.internal.server.BspCompileTask$.$anonfun$compute$1(BspCompileTask.scala:30) [error] sbt.internal.io.Retry$.apply(Retry.scala:46) [error] sbt.internal.io.Retry$.apply(Retry.scala:28) [error] sbt.internal.io.Retry$.apply(Retry.scala:23) [error] sbt.internal.server.BspCompileTask$.compute(BspCompileTask.scala:30) [error] sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:2311) [error] scala.Function1.$anonfun$compose$1(Function1.scala:49) [error] sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62) [error] sbt.std.Transform$$anon$4.work(Transform.scala:68) [error] sbt.Execute.$anonfun$submit$2(Execute.scala:282) [error] sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23) [error] sbt.Execute.work(Execute.scala:291) [error] sbt.Execute.$anonfun$submit$1(Execute.scala:282) [error] sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265) [error] sbt.CompletionService$$anon$2.call(CompletionService.scala:64) [error] java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) [error] java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) [error] java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) [error] java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [error] java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [error] java.base/java.lang.Thread.run(Thread.java:833) [error] ```
smarter commented 1 year ago

If needed, I could create a repository with moke versions of the proprietary code but the problem and stack is exactly the same as https://github.com/lampepfl/dotty/issues/16439

That would be really helpful yes!

odersky commented 1 year ago

The previous error from #16439 was fixed. Can you verify that the error is still present when compiling with the latest nightly?

pmeheut commented 1 year ago

I just tried with Scala 3.3.2-RC1-bin-20230705-13f877b-NIGHTLY Same error:

`` unhandled exception while running MegaPhase{lambdaLift, elimStaticThis, countOuterAccesses} on /Users/pascal/Qarmin/gitlab/qarmin/development/WebReport/webPage/src/main/scala/io/softhedge/webreport/pages/TimePeriod.scala

An unhandled exception was thrown in the compiler. Please file a crash report here: https://github.com/lampepfl/dotty/issues/new/choose

 while compiling: /Users/pascal/Qarmin/gitlab/qarmin/development/WebReport/webPage/src/main/scala/io/softhedge/webreport/pages/TimePeriod.scala
    during phase: MegaPhase{lambdaLift, elimStaticThis, countOuterAccesses}
            mode: Mode(ImplicitsEnabled)
 library version: version 2.13.10
compiler version: version 3.3.2-RC1-bin-20230705-13f877b-NIGHTLY-git-13f877b
        settings: -bootclasspath /Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.3.2-RC1-bin-20230705-13f877b-NIGHTLY/scala3-library_3-3.3.2-RC1-bin-20230705-13f877b-NIGHTLY.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-library/2.13.10/scala-library-2.13.10.jar -classpath /Users/pascal/Qarmin/gitlab/qarmin/development/WebReport/webPage/target/scala-3.3.2-RC1-bin-20230705-13f877b-NIGHTLY/classes:/Users/pascal/Qarmin/gitlab/qarmin/development/WebReport/core/js/target/scala-3.3.2-RC1-bin-20230705-13f877b-NIGHTLY/classes:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_sjs1_3/3.3.2-RC1-bin-20230705-13f877b-NIGHTLY/scala3-library_sjs1_3-3.3.2-RC1-bin-20230705-13f877b-NIGHTLY.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-js/scalajs-library_2.13/1.13.0/scalajs-library_2.13-1.13.0.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/github/ghostdogpr/caliban-client_3/2.0.1/caliban-client_3-2.0.1.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/webjars/npm/plotly.js-dist-min/2.12.1/plotly.js-dist-min-2.12.1.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-js/scalajs-dom_sjs1_3/2.3.0/scalajs-dom_sjs1_3-2.3.0.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/scalatags_sjs1_3/0.12.0/scalatags_sjs1_3-0.12.0.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/dev/zio/zio_sjs1_3/2.0.5/zio_sjs1_3-2.0.5.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/softwaremill/sttp/client3/core_sjs1_3/3.8.3/core_sjs1_3-3.8.3.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/softwaremill/sttp/client3/circe_sjs1_3/3.8.3/circe_sjs1_3-3.8.3.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/softwaremill/sttp/client3/zio_sjs1_3/3.8.3/zio_sjs1_3-3.8.3.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/raquo/laminar_sjs1_3/0.14.5/laminar_sjs1_3-0.14.5.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/be/doeraene/web-components-ui5_sjs1_3/1.9.0/web-components-ui5_sjs1_3-1.9.0.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/openmole/scala-js-plotlyjs_sjs1_3/1.6.2/scala-js-plotlyjs_sjs1_3-1.6.2.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/raquo/waypoint_sjs1_3/6.0.0/waypoint_sjs1_3-6.0.0.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/github/ghostdogpr/caliban-client_sjs1_3/2.0.1/caliban-client_sjs1_3-2.0.1.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/github/cquiroz/scala-java-time_sjs1_3/2.4.0/scala-java-time_sjs1_3-2.4.0.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/github/pmeheut/nscala-java-time_sjs1_3/0.1.1/nscala-java-time_sjs1_3-0.1.1.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/circe/circe-generic_sjs1_3/0.14.3/circe-generic_sjs1_3-0.14.3.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/circe/circe-parser_sjs1_3/0.14.3/circe-parser_sjs1_3-0.14.3.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/laminext/core_sjs1_3/0.14.3/core_sjs1_3-0.14.3.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/laminext/fetch_sjs1_3/0.14.3/fetch_sjs1_3-0.14.3.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/laminext/fetch-circe_sjs1_3/0.14.3/fetch-circe_sjs1_3-0.14.3.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/laminext/websocket_sjs1_3/0.14.3/websocket_sjs1_3-0.14.3.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/laminext/websocket-circe_sjs1_3/0.14.3/websocket-circe_sjs1_3-0.14.3.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/github/ghostdogpr/caliban-client-laminext_sjs1_3/2.0.1/caliban-client-laminext_sjs1_3-2.0.1.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-js/scalajs-javalib/1.13.0/scalajs-javalib-1.13.0.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.1.3/scala3-library_3-3.1.3.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/circe/circe-parser_3/0.14.2/circe-parser_3-0.14.2.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/softwaremill/sttp/client3/core_3/3.7.2/core_3-3.7.2.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/softwaremill/sttp/client3/circe_3/3.7.2/circe_3-3.7.2.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/sourcecode_sjs1_3/0.3.0/sourcecode_sjs1_3-0.3.0.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/geny_sjs1_3/1.0.0/geny_sjs1_3-1.0.0.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/dev/zio/zio-internal-macros_sjs1_3/2.0.5/zio-internal-macros_sjs1_3-2.0.5.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/dev/zio/zio-stacktracer_sjs1_3/2.0.5/zio-stacktracer_sjs1_3-2.0.5.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/dev/zio/izumi-reflect_sjs1_3/2.2.2/izumi-reflect_sjs1_3-2.2.2.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-js/scala-js-macrotask-executor_sjs1_3/1.0.0/scala-js-macrotask-executor_sjs1_3-1.0.0.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-js/scalajs-weakreferences_sjs1_2.13/1.0.0/scalajs-weakreferences_sjs1_2.13-1.0.0.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/softwaremill/sttp/model/core_sjs1_3/1.5.2/core_sjs1_3-1.5.2.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/softwaremill/sttp/shared/core_sjs1_3/1.3.10/core_sjs1_3-1.3.10.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/softwaremill/sttp/shared/ws_sjs1_3/1.3.10/ws_sjs1_3-1.3.10.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-js/scalajs-java-securerandom_sjs1_2.13/1.0.0/scalajs-java-securerandom_sjs1_2.13-1.0.0.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/softwaremill/sttp/client3/json-common_sjs1_3/3.8.3/json-common_sjs1_3-3.8.3.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/circe/circe-core_sjs1_3/0.14.3/circe-core_sjs1_3-0.14.3.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/dev/zio/zio-streams_sjs1_3/2.0.2/zio-streams_sjs1_3-2.0.2.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/softwaremill/sttp/shared/zio_sjs1_3/1.3.10/zio_sjs1_3-1.3.10.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/raquo/airstream_sjs1_3/15.0.0/airstream_sjs1_3-15.0.0.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/raquo/domtypes_sjs1_3/0.15.3/domtypes_sjs1_3-0.15.3.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/querki/querki-jsext_sjs1_2.13/0.10/querki-jsext_sjs1_2.13-0.10.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/be/doeraene/url-dsl_sjs1_3/0.6.0/url-dsl_sjs1_3-0.6.0.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/portable-scala/portable-scala-reflect_sjs1_2.13/1.1.2/portable-scala-reflect_sjs1_2.13-1.1.2.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/github/cquiroz/scala-java-locales_sjs1_3/1.4.0/scala-java-locales_sjs1_3-1.4.0.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/circe/circe-scalajs_sjs1_3/0.14.3/circe-scalajs_sjs1_3-0.14.3.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/laminext/util_sjs1_3/0.14.3/util_sjs1_3-0.14.3.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/circe/circe-jawn_3/0.14.2/circe-jawn_3-0.14.2.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/circe/circe-core_3/0.14.2/circe-core_3-0.14.2.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/softwaremill/sttp/model/core_3/1.5.0/core_3-1.5.0.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/softwaremill/sttp/shared/core_3/1.3.7/core_3-1.3.7.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/softwaremill/sttp/shared/ws_3/1.3.7/ws_3-1.3.7.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/softwaremill/sttp/client3/json-common_3/3.7.2/json-common_3-3.7.2.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/dev/zio/izumi-reflect-thirdparty-boopickle-shaded_sjs1_3/2.2.2/izumi-reflect-thirdparty-boopickle-shaded_sjs1_3-2.2.2.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/circe/circe-numbers_sjs1_3/0.14.3/circe-numbers_sjs1_3-0.14.3.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/typelevel/cats-core_sjs1_3/2.8.0/cats-core_sjs1_3-2.8.0.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/app/tulz/tuplez-full-light_sjs1_3/0.4.0/tuplez-full-light_sjs1_3-0.4.0.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/raquo/ew_sjs1_3/0.1.2/ew_sjs1_3-0.1.2.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/github/cquiroz/cldr-api_sjs1_3/3.1.0/cldr-api_sjs1_3-3.1.0.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/typelevel/jawn-parser_3/1.3.2/jawn-parser_3-1.3.2.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/circe/circe-numbers_3/0.14.2/circe-numbers_3-0.14.2.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/typelevel/cats-core_3/2.7.0/cats-core_3-2.7.0.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/typelevel/cats-kernel_sjs1_3/2.8.0/cats-kernel_sjs1_3-2.8.0.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/typelevel/cats-kernel_3/2.7.0/cats-kernel_3-2.7.0.jar:/Users/pascal/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/typelevel/simulacrum-scalafix-annotations_3/0.5.4/simulacrum-scalafix-annotations_3-0.5.4.jar -d /Users/pascal/Qarmin/gitlab/qarmin/development/WebReport/webPage/target/scala-3.3.2-RC1-bin-20230705-13f877b-NIGHTLY/classes -scalajs true

            tree: EmptyTree
   tree position: :<unknown>
       tree type: <notype>
          symbol: val <none>
       call site: package <root> in module class <root>

== Source file context for tree position ==

[error] ## Exception when compiling 7 sources to /Users/pascal/Qarmin/gitlab/qarmin/development/WebReport/webPage/target/scala-3.3.2-RC1-bin-20230705-13f877b-NIGHTLY/classes [error] java.lang.AssertionError: assertion failed [error] scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:11) [error] dotty.tools.dotc.core.Types$MethodType.(Types.scala:3981) [error] dotty.tools.dotc.core.Types$CachedMethodType.(Types.scala:3999) ... ``

odersky commented 1 year ago

Ah, OK. That's actually does not look like the error in https://github.com/lampepfl/dotty/issues/16439. So, yes, a minimization would be really helpful!

pmeheut commented 1 year ago

There is an example here: git@github.com:pmeheut/scala_bug.git This is the smallest I could do reasonably.

sbt compile works. Uncomment ++ waypointCross.value line 16 in build.sbt and sbt compilefails with the error above.

smarter commented 1 year ago

I figured out the root cause of the issue: when waypoint is added as a library, the transitive dependency com.raquo::airstream was upgraded from 0.14.5 to 15.0.0, this upgrade is not binary-compatible and in particular it removes the SwitchFutureStrategy object which the compiler tries to access while computing the trait setters of com.raquo.laminar.api.L.Val

smarter commented 1 year ago

Upgrading libraries to the new airstream fixes the crash:

diff --git project/Dependencies.scala project/Dependencies.scala
index 210a43b..cd1d26c 100644
--- project/Dependencies.scala
+++ project/Dependencies.scala
@@ -2,7 +2,7 @@ import sbt._
 import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._

 object Dependencies {
-  val calibanVersion = "2.0.1"
+  val calibanVersion = "2.2.1"

   val sttpVersion = "3.8.3"

@@ -27,9 +27,9 @@ object Dependencies {
   val scalaTagsVersion = "0.12.0"
   val circeVersion = "0.14.3"

-  val laminarVersion = "0.14.5"
-  val laminextVersion = "0.14.3"
-  val laminarUI5Version = "1.9.0"
+  val laminarVersion = "15.0.1"
+  val laminextVersion = "0.15.0"
+  val laminarUI5Version = "1.10.0"
   val waypointVersion = "6.0.0"
   val scalajsPlotlyJsVersion = "1.6.2"
   val plotlyJsVersion = "2.12.1"

There's a few compiler errors though, one is an issue with circe and caliban (which I see you reported before https://github.com/lampepfl/dotty/issues/18166, but should probably be reported to caliban instead) and the other are API changes in caliban.

pmeheut commented 1 year ago

Thanks for the quick diagnostic.