cornerman/sloth

Error when use method with multiple parameter list

polkx opened this issue · 2 comments

polkx commented

Code to test:

package test

import cats.implicits._
import sloth.Router

import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.Future

trait Api {
  def fun(a: Int, b: String)(c: Double): Future[Int]
}

object ApiImpl extends Api {
  def fun(a: Int, b: String)(c: Double): Future[Int] = Future(0)
}


object Test extends App {
  Router[String, Future].route[Api](ApiImpl)
}

When i run the above code i get an error. Does this library support multiple parameter list? How can i solve this problem?

Error:
type mismatch;
found : String
required: Double
Router[String, Future].route[Api] (ApiImpl)

Good find, thank you for opening this issue.

There has been a regression with handling multiple parameter lists, which I have fixed now in #189. Will merge and then make a new release 🙏

@polkx This fix has been released in version 0.6.6 now. Will probably take a few moments to be resolvable on maven.