arainko / ducktape

Automatic and customizable compile time transformations between similar case classes and sealed traits/enums, essentially a thing that glues your code. Scala 3 only. Or is it duct 🤔

Home Page:https://arainko.github.io/ducktape/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compile-time exception on 0.1.6 when using Scala 3.3.0-RC5 with `-Wunused:all`

chuwy opened this issue · comments

Tried to upgrade from 0.1.4 to 0.1.6 and getting the following exception, presumably related to #48.

[error] ## Exception when compiling 102 sources to /Users/.../target/scala-3.3.0-RC5/classes
[error] dotty.tools.dotc.core.TypeError$$anon$1: Toplevel definition inline$Transformations$i1 is defined in
[error]   /Users/chuwy/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/github/arainko/ducktape_3/0.1.6/ducktape_3-0.1.6.jar(io/github/arainko/ducktape/fallibleSyntax$package.class)
[error] and also in
[error]   /Users/chuwy/Library/Caches/Coursier/v1/https/repo1.maven.org/maven2/io/github/arainko/ducktape_3/0.1.6/ducktape_3-0.1.6.jar(io/github/arainko/ducktape/syntax$package.class)
[error] One of these files should be removed from the classpath.

Apart from above lines I don't see any other useful info, just a bunch of my files listed.

Scalac 3.3.0-RC5, 0.1.5 compiles fine.

Thanks for the report!

Does this occur at any particular usage site or does it just die without much fanfare?

I'm unable to reproduce this locally (using this repo: https://github.com/arainko/ducktape-talk) - the project compiles just fine on Scala 3.2.2:

sbt:root> compile
[info] compiling 2 Scala sources to /home/aleksander/repos/ducktape-talk/libs/newtypes/target/scala-3.2.2/classes ...
[info] compiling 9 Scala sources to /home/aleksander/repos/ducktape-talk/modules/domain/target/scala-3.2.2/classes ...
[info] compiling 4 Scala sources to /home/aleksander/repos/ducktape-talk/modules/infrastructure/target/scala-3.2.2/classes ...
[info] compiling 18 Scala sources to /home/aleksander/repos/ducktape-talk/http/target/scala-3.2.2/classes ...
[success] Total time: 30 s, completed May 2, 2023, 2:35:54 PM

The same for Scala 3.3.0-RC5:

[info] compiling 4 Scala sources to /home/aleksander/repos/ducktape-talk/libs/newtypes/target/scala-3.3.0-RC5/classes ...
[info] compiling 9 Scala sources to /home/aleksander/repos/ducktape-talk/modules/domain/target/scala-3.3.0-RC5/classes ...
[info] compiling 4 Scala sources to /home/aleksander/repos/ducktape-talk/modules/infrastructure/target/scala-3.3.0-RC5/classes ...
[info] compiling 18 Scala sources to /home/aleksander/repos/ducktape-talk/http/target/scala-3.3.0-RC5/classes ...
[success] Total time: 9 s, completed May 2, 2023, 2:39:37 PM

Is the project that crashes open source? If not, would you be able to at least share your build configuration (scalac flags etc.)?

After some more playing around with it I'm able to reproduce it by using -Wunused:all on Scala 3.3.0-RC5. That sadly smells like a dotty issue to me - I'll try to minimize

Just released ducktape 0.1.7 with a workaround for this issue - I'll still make sure to report this to the dotty maintainers.