scalacenter / bloop

Bloop is a build server and CLI tool to compile, test and run Scala fast from any editor or build tool.
https://scalacenter.github.io/bloop/
Apache License 2.0
907 stars 201 forks source link

Cannot compile Scala 3 export zio.test.Gen.* #1883

Open chessman opened 1 year ago

chessman commented 1 year ago

Bloop version: 1.5.4 Scala: 3.2.1 ZIO: 2.0.2

object A {
  export zio.test.Gen.*
}

bloop compile returns an error:

[E] [E1] test/shared/src/main/scala/zio/test/TimeVariants.scala
[E]      undefined: new com.github.ghik.silencer.silent # -1: TermRef(TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class ghik)),object silencer),silent),<init>) at extractSemanticDB
tgodzik commented 1 year ago

Thanks for reporting! Looks like the silencer plugin interferes here? Does it work if it's disabled?

chessman commented 1 year ago

@tgodzik It is used in ZIO, so probably it's not possible to disable it. test/shared/src/main/scala/zio/test/TimeVariants.scala:

  import com.github.ghik.silencer.silent
  ...
  @silent("JavaConverters")
  final def zoneId(implicit trace: Trace): Gen[Any, ZoneId] =
tgodzik commented 1 year ago

Looks like a bug in semanticdb anyway, we probably need to fix it there.

As for silencer, it could probably be removed in favour of nowarn

NOTE: Scala 2.13.2 and 2.12.13 introduced https://github.com/scala/scala/pull/8373. This means that unless you're still cross compiling for Scala 2.11, this plugin is obsolete, and you should use [@nowarn](https://www.scala-lang.org/api/current/scala/annotation/nowarn.html).