Skip to content

Scala 2.13.6 Unused Parameter Value for Higher Kinded Type #524

@theoilie

Description

@theoilie

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions