[error] /.../Routes.scala:40:42: ambiguous implicit values:
[error] both value fromQueryParamDecoder in class Resource of type => org.http4s.QueryParamDecoder[java.time.LocalDate]
[error] and value toQueryParamDecoder in class Resource of type => org.http4s.QueryParamDecoder[java.time.LocalDate]
[error] match expected type org.http4s.QueryParamDecoder[java.time.LocalDate]
[error] object GetEventsFromMatcher extends OptionalQueryParamDecoderMatcher[java.time.LocalDate]("from")
[error] ^
[error] /.../Routes.scala:42:40: ambiguous implicit values:
[error] both value fromQueryParamDecoder in class Resource of type => org.http4s.QueryParamDecoder[java.time.LocalDate]
[error] and value toQueryParamDecoder in class Resource of type => org.http4s.QueryParamDecoder[java.time.LocalDate]
[error] match expected type org.http4s.QueryParamDecoder[java.time.LocalDate]
[error] object GetOccasionsToMatcher extends OptionalQueryParamDecoderMatcher[java.time.LocalDate]("to")
The two generated implicits are prefixed with the parameter but have the same type signature and body.
If we prefix the implicit ParamDecoder with the param's type instead of the param's name and deduplicate those this problem is solved.
I suspect this problem also surfaces with types other than date but I haven't tested this.
When I run the http4s server code generator with the following (minimal) specification
It generates the following code:
When I compile, I get the following error:
The two generated
implicit
s are prefixed with theparameter
but have the same type signature and body. If we prefix the implicitParamDecoder
with the param's type instead of the param's name and deduplicate those this problem is solved.I suspect this problem also surfaces with types other than
date
but I haven't tested this.