scala / scala3

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

unhandled exception while running checkUnusedPostInlining #18674

Open kubukoz opened 11 months ago

kubukoz commented 11 months ago

Compiler version

3.3.1

Minimized code

unavailable

Output (click arrow to expand)

```scala unhandled exception while running checkUnusedPostInlining on /Users/kubukoz/projects/smithy-playground/modules/source/src/test/scala/playground/smithyql/Diffs.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: during phase: mode: Mode(ImplicitsEnabled) library version: version 2.13.10 compiler version: version 3.3.1 settings: -Wconf List(cat=deprecation:silent, msg=Specify both message and version:silent) -Wnonunit-statement true -Wunused List(implicits, explicits, imports, locals, params, privates) -Wvalue-discard true -Xplugin List(/Users/kubukoz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/polyvariant/better-tostring_3.3.1/0.3.17/better-tostring_3.3.1-0.3.17.jar) -Ykind-projector "" -bootclasspath /Users/kubukoz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala3-library_3/3.3.1/scala3-library_3-3.3.1.jar:/Users/kubukoz/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/kubukoz/projects/smithy-playground/modules/source/target/scala-3.3.1/test-classes:/Users/kubukoz/projects/smithy-playground/modules/source/target/scala-3.3.1/classes:/Users/kubukoz/projects/smithy-playground/modules/ast/target/scala-3.3.1/classes:/Users/kubukoz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/typelevel/cats-core_3/2.10.0/cats-core_3-2.10.0.jar:/Users/kubukoz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/typelevel/cats-mtl_3/1.3.1/cats-mtl_3-1.3.1.jar:/Users/kubukoz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/disneystreaming/weaver-cats_3/0.8.3/weaver-cats_3-0.8.3.jar:/Users/kubukoz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/disneystreaming/weaver-discipline_3/0.8.3/weaver-discipline_3-0.8.3.jar:/Users/kubukoz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/disneystreaming/weaver-scalacheck_3/0.8.3/weaver-scalacheck_3-0.8.3.jar:/Users/kubukoz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/softwaremill/diffx/diffx-core_3/0.9.0/diffx-core_3-0.9.0.jar:/Users/kubukoz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/softwaremill/diffx/diffx-cats_3/0.9.0/diffx-cats_3-0.9.0.jar:/Users/kubukoz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/typelevel/cats-kernel_3/2.10.0/cats-kernel_3-2.10.0.jar:/Users/kubukoz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/disneystreaming/weaver-framework_3/0.8.3/weaver-framework_3-0.8.3.jar:/Users/kubukoz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/disneystreaming/weaver-cats-core_3/0.8.3/weaver-cats-core_3-0.8.3.jar:/Users/kubukoz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/disneystreaming/weaver-core_3/0.8.3/weaver-core_3-0.8.3.jar:/Users/kubukoz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/typelevel/discipline-core_3/1.5.1/discipline-core_3-1.5.1.jar:/Users/kubukoz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scalacheck/scalacheck_3/1.17.0/scalacheck_3-1.17.0.jar:/Users/kubukoz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/softwaremill/magnolia1_3/magnolia_3/1.1.4/magnolia_3-1.1.4.jar:/Users/kubukoz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-sbt/test-interface/1.0/test-interface-1.0.jar:/Users/kubukoz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/junit/junit/4.13.2/junit-4.13.2.jar:/Users/kubukoz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/eed3si9n/expecty/expecty_3/0.16.0/expecty_3-0.16.0.jar:/Users/kubukoz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/portable-scala/portable-scala-reflect_2.13/1.1.2/portable-scala-reflect_2.13-1.1.2.jar:/Users/kubukoz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.13.10/scala-reflect-2.13.10.jar:/Users/kubukoz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/co/fs2/fs2-core_3/3.5.0/fs2-core_3-3.5.0.jar:/Users/kubukoz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/typelevel/cats-effect_3/3.4.6/cats-effect_3-3.4.6.jar:/Users/kubukoz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar:/Users/kubukoz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/scodec/scodec-bits_3/1.1.34/scodec-bits_3-1.1.34.jar:/Users/kubukoz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/typelevel/cats-effect-kernel_3/3.4.6/cats-effect-kernel_3-3.4.6.jar:/Users/kubukoz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/org/typelevel/cats-effect-std_3/3.4.6/cats-effect-std_3-3.4.6.jar -d /Users/kubukoz/projects/smithy-playground/modules/source/target/scala-3.3.1/test-classes -deprecation true -encoding utf8 -feature true -java-output-version 11 -language List(experimental.macros, higherKinds, implicitConversions) -no-indent true tree: EmptyTree tree position: : tree type: symbol: val call site: package in module class == Source file context for tree position == [error] ## Exception when compiling 2 sources to /Users/kubukoz/projects/smithy-playground/modules/source/target/scala-3.3.1/test-classes [error] dotty.tools.dotc.core.TypeError$$anon$1: Toplevel definition Typeclass is defined in [error] /Users/kubukoz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/softwaremill/magnolia1_3/magnolia_3/1.1.4/magnolia_3-1.1.4.jar(magnolia1/SealedTraitDerivation.class) [error] and also in [error] /Users/kubukoz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/softwaremill/magnolia1_3/magnolia_3/1.1.4/magnolia_3-1.1.4.jar(magnolia1/CommonDerivation.class) [error] One of these files should be removed from the classpath. [error] [error] [error] stack trace is suppressed; run last source / Test / compileIncremental for the full output [error] (source / Test / compileIncremental) dotty.tools.dotc.core.TypeError$$anon$1: Toplevel definition Typeclass is defined in [error] /Users/kubukoz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/softwaremill/magnolia1_3/magnolia_3/1.1.4/magnolia_3-1.1.4.jar(magnolia1/SealedTraitDerivation.class) [error] and also in [error] /Users/kubukoz/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/com/softwaremill/magnolia1_3/magnolia_3/1.1.4/magnolia_3-1.1.4.jar(magnolia1/CommonDerivation.class) [error] One of these files should be removed from the classpath. ```
bishabosha commented 11 months ago

@kubukoz Any chance of a public GitHub repo + some steps to follow?

kubukoz commented 11 months ago

That seems within reach! The repo is public, I'll just need to restore this state but it shouldn't take long.

kubukoz commented 11 months ago

Reproduction:

  1. Clone https://github.com/kubukoz/smithy-playground/tree/restore-flag
  2. sbt source/Test/compile
  3. See crash in compiler output

My workaround is to remove the -Wunused:implicits option, which seems to be the minimum requirement for reaching this case.

bishabosha commented 11 months ago

Thanks, I reproduced it :)