zio-http icon indicating copy to clipboard operation
zio-http copied to clipboard

Server.install reporting "unused local definition" in 3.1.0.

Open m-kalai opened this issue 9 months ago • 2 comments

Describe the bug When trying to upgrade to 3.1.0, build started to fail due to Server.install reporting "unused local definition". It's just a warning but imo it shouldn't be there and with "fatal warnings" it breaks builds.

To Reproduce Steps to reproduce the behaviour: Example: https://github.com/m-kalai/zio-http-unused-local/blob/master/src/main/scala/cz/kalai/issue/ZioHttpApp.scala

fails with

/zio-http-unused-local/src/main/scala/cz/kalai/issue/ZioHttpApp.scala:17:23
unused local definition
      .install(routes)

Reproduced with Scala 3.3.5 and 3.6.4. Note: Removing line 14 with ZIO.logInfo makes it work.

Expected behaviour No warnings are generated and code compiles.

Desktop (please complete the following information):

  • OS: macOS

Additional context Add any other context about the problem here.

m-kalai avatar Mar 18 '25 19:03 m-kalai

This is a Scala 3 bug, which is fixed but not released yet. It might be back ported to 3.3.x with 3.3.7

https://github.com/scala/scala3/pull/20894?notification_referrer_id=NT_kwDOAG8jT7MxMTI5OTA1NzA3NDo3MjgzNTM1&notifications_query=repo%3Ascala%2Fscala3

987Nabil avatar Mar 24 '25 10:03 987Nabil

Here is the link to the back port PR

987Nabil avatar Apr 16 '25 11:04 987Nabil