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

unhandled exception while running checkUnusedPostInlining #18674

Closed
kubukoz opened this issue Oct 10, 2023 · 8 comments
Closed

unhandled exception while running checkUnusedPostInlining #18674

kubukoz opened this issue Oct 10, 2023 · 8 comments

Comments

@kubukoz
Copy link
Contributor

kubukoz commented Oct 10, 2023

Compiler version

3.3.1

Minimized code

unavailable

Output (click arrow to expand)

  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: <no file>
        during phase: <no 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: :<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 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.
@kubukoz kubukoz added itype:bug itype:crash stat:needs triage Every issue needs to have an "area" and "itype" label labels Oct 10, 2023
@nicolasstucki nicolasstucki added the stat:needs minimization Needs a self contained minimization label Oct 12, 2023
@bishabosha
Copy link
Member

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

@bishabosha bishabosha added area:classpath and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Oct 13, 2023
@kubukoz
Copy link
Contributor Author

kubukoz commented Oct 15, 2023

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

@kubukoz
Copy link
Contributor Author

kubukoz commented Oct 15, 2023

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 bishabosha removed the stat:needs minimization Needs a self contained minimization label Oct 16, 2023
@bishabosha
Copy link
Member

Thanks, I reproduced it :)

@kubukoz
Copy link
Contributor Author

kubukoz commented Oct 28, 2024

not rushing, but just wanted to note this is still a thing in 3.5.2 3.6.2

@som-snytt
Copy link
Contributor

som-snytt commented Oct 29, 2024

Duplicate of #17394

I see the comments there were just a few days after this ticket, but I don't know if that's coincidence or someone searched for the error string.

I said it's on the member lookup for the import given, and I assume I meant it's not fixed in my PR for unused check.

Edit: I missed the "Context" section on the other ticket, which identifies a naming clash and a workaround for that example. I'll try to make time to try out this example, too. I can't tell offhand if it's likely to get an "underlying" fix, or if the check can work around the existing behavior.

@som-snytt
Copy link
Contributor

Closing as duplicate. Could not build locally without minimization.

[error] sbt.librarymanagement.ResolveException: Error downloading org.polyvariant:better-tostring_3.6.4-RC1-bin-SNAPSHOT:0.3.17

@kubukoz
Copy link
Contributor Author

kubukoz commented Jan 16, 2025

Can you try removing the plugin from dependencies? It shouldn't affect the rest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants