-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed as duplicate of#17753
Labels
Description
Compiler version
Tested with 3.3.x and 3.6.x
Minimized code
Please take a look at this bug report in zio
//> using dep "dev.zio::zio-http:3.1.0"
//> using options "-Wunused:locals" "-Xfatal-warnings"
import zio.*
val x: HasNoScope[Any] = HasNoScope.hasNoScope[Any] //Works
val z: HasNoScope[Any] = { HasNoScope.hasNoScope[Any] } //Warning
Output
[error] ./main.sc:6:49
[error] unused local definition
[error] val z: HasNoScope[Any] = { HasNoScope.hasNoScope[Any] } //Unused
[error]
Expectation
No such unused warning.
If I inline the code of the macro manually, there is no warning. (See code in the zio issue)
That's why this smells like a compiler bug to me.