SuppressWarnings on ExplicitResultTypes gets Unused Scalafix suppression warning
esamson opened this issue · comments
Edward Samson commented
Quill docs say I should avoid giving explicit types to quotations. So I suppress ExplicitResultTypes in like so:
import io.getquill.Literal
import io.getquill.jdbczio.Quill
import my.project.Organizations
@SuppressWarnings(Array("scalafix:ExplicitResultTypes"))
case class DbService(quill: Quill.Postgres[Literal]) {
import quill._
val organizations = quote(query[Organizations])
def orgByName = quote((name: String) =>
organizations.filter(org => org.name == name)
)
}
This works. Scalafix doesn't add explicit types. But I get this warning:
[warn] /home/.../DbService.scala:8:26: warning: [UnusedScalafixSuppression] Unused Scalafix suppression, this can be removed
[warn] @SuppressWarnings(Array("scalafix:ExplicitResultTypes"))
[warn] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Which is wrong because the suppression is definitely in use. If I remove it then Scalafix would write in the explicit types.
Brice Jaglin commented
Edward Samson commented
Thanks for checking this, @bjaglin . Indeed, I don't see this happening in the latest version of my project. It's probably not worth the time digging up what bad combination I had that caused this before. Sorry for the trouble.
Brice Jaglin commented
No worry, thanks for getting back to me!