From 05a79777d79fe837e22490433cba63580876edef Mon Sep 17 00:00:00 2001 From: Antoine Doeraene Date: Wed, 3 Jul 2024 19:55:21 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20Fixed=20some=20inference=20for?= =?UTF-8?q?=20scala=202.x?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/scala/urldsl/language/QueryParameters.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/url-dsl/src/main/scala/urldsl/language/QueryParameters.scala b/url-dsl/src/main/scala/urldsl/language/QueryParameters.scala index ff6d367..d8fe0e9 100644 --- a/url-dsl/src/main/scala/urldsl/language/QueryParameters.scala +++ b/url-dsl/src/main/scala/urldsl/language/QueryParameters.scala @@ -100,7 +100,7 @@ trait QueryParameters[Q, +A] extends UrlPart[Q, A] { * should that change? * * @example - * {{{ param[Int]("age").filter(_ >= 0, (params: Map[String, Param]) => someError(params)) }}} + * {{{param[Int]("age").filter(_ >= 0, (params: Map[String, Param]) => someError(params))}}} * * @param predicate * the additional predicate that the output must satisfy @@ -201,7 +201,7 @@ object QueryParameters { case Param(Nil) => Left(paramMatchingError.missingParameterError(paramName)) case Param(head :: _) => fromString(head) }, - q => Param(List(printer(q))) + (q: Q) => Param(List(printer(q))) ) final def listParam[Q, A]( @@ -226,9 +226,9 @@ object QueryParameters { } .map(_.reverse) }, - q => Param(q.map(printer.apply)), + (q: List[Q]) => Param(q.map(printer.apply)), // If `paramName` is not present in the parameters we should return an empty list. - onParameterNotFound = params => Right(ParamMatchOutput(Nil, params)) + onParameterNotFound = (params: Map[String, Param]) => Right(ParamMatchOutput(List.empty[Q], params)) ) final lazy val dummyErrorImpl = QueryParametersImpl[DummyError]