-
Notifications
You must be signed in to change notification settings - Fork 32
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
Unused warning on scala 2.13.5 #50
Comments
I tried with https://github.com/sirthias/macrolizer object Main extends App {
macrolizer.show {
for {
implicit0(i: Int) <- Option(1)
} yield p("i")
}
def p(prefix: String)(implicit i: Int): Unit =
println(s"$prefix: $i")
} generated expanded code for both versions:
The From Scala 2.13.5 release notes:
|
Yeah I'd have to look for a new workaround for that warning. The linter has always produced bogus warnings in that scenario, but I was able to silence it using a synthetic flag previously. Given that dotty is around the corner and it's gonna break all plugins and such anyways I'm not going to look deeply into that for now. Since plugin consistently uses that scalacOptions += "-Wconf:msg=\\$implicit\\$:s" |
Warning for synthetic param is under The buffet menu is |
|
I see it can be selectively disabled (if your build.sbt is simple, I guess):
I'm glad |
@som-snytt and @oleg-py, thank you! |
as I understood, usage of |
Oh by the way, bm4 doesn't do explicit implicits itself. Macros and implicit resolution run during typer phase, and, afaik, the unused lint does as well. My speculation is that they aren't deterministically ordered between themselves, causing warnings before the implicits are fully resolved to be needed. |
The lint is done at the end of typer; during typer, trees are typechecked both before and after macro expansion, and both typechecks will do implicit resolution as needed. The lint looks at either or both of the unexpanded and expanded trees, depending on |
Given build.sbt
And main
I get warning
I do not get this on 2.13.4.
It still works and can be passed as an implicit, its just a bad warning produced.
The text was updated successfully, but these errors were encountered: