Skip to content
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

Scala 2.13.6 Unused Parameter Value for Higher Kinded Type #524

Open
theoilie opened this issue Jun 29, 2021 · 1 comment
Open

Scala 2.13.6 Unused Parameter Value for Higher Kinded Type #524

theoilie opened this issue Jun 29, 2021 · 1 comment

Comments

@theoilie
Copy link

When cloning the latest version of scala-pet-store and changing build.sbt to only compile to Scala 2.13.6 (i.e., changing crossScalaVersions := Seq("2.12.14", "2.13.6") to scalaVersion := "2.13.6"), sbt compile gives the following error about the higher kinded type for Cats Effect Sync being unused:

[info] compiling 36 Scala sources to <LOCAL_PATH_REDACTED>/scala-pet-store/target/scala-2.13/classes ...
[error] <LOCAL_PATH_REDACTED>/scala-pet-store/src/main/scala/io/github/pauljamescleary/petstore/infrastructure/endpoint/OrderEndpoints.scala:19:26: parameter value evidence$2 in class OrderEndpoints is never used
[error] class OrderEndpoints[F[_]: Sync, Auth: JWTMacAlgo] extends Http4sDsl[F] {
[error]                          ^
[error] <LOCAL_PATH_REDACTED>/scala-pet-store/src/main/scala/io/github/pauljamescleary/petstore/infrastructure/endpoint/PetEndpoints.scala:21:24: parameter value evidence$2 in class PetEndpoints is never used
[error] class PetEndpoints[F[_]: Sync, Auth: JWTMacAlgo] extends Http4sDsl[F] {
[error]                        ^
[error] <LOCAL_PATH_REDACTED>/scala-pet-store/src/main/scala/io/github/pauljamescleary/petstore/infrastructure/endpoint/UserEndpoints.scala:21:25: parameter value evidence$2 in class UserEndpoints is never used
[error] class UserEndpoints[F[_]: Sync, A, Auth: JWTMacAlgo] extends Http4sDsl[F] {
[error]                         ^
[error] three errors found
[error] (Compile / compileIncremental) Compilation failed

This could be an upstream issue with sbt-tpolecat or some kind of incompatibility between the Scala compiler and/or Sync and/or higher kinded types. Or I could be interpreting this incorrectly. Anyway, the quick and dirty solution for anyone else having this problem is to disable the sbt-tpolecat plugin (comment it out in project/plugins.sbt) and declare your own scalac options in build.sbt.

@theoilie theoilie changed the title Scala 2.13.6 Unused False Positive Scala 2.13.6 Unused Parameter Value for Higher Kinded Type Jun 29, 2021
@theoilie
Copy link
Author

An alternative solution is to continue using the sbt-tpolecat plugin and make the compiler not fail on warnings:

// build.sbt
scalacOptions --= Seq(
  "-Xfatal-warnings",
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant