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

route does not compile for some complicated return value #55

Open
Atry opened this issue Dec 11, 2016 · 1 comment
Open

route does not compile for some complicated return value #55

Atry opened this issue Dec 11, 2016 · 1 comment

Comments

@Atry
Copy link

Atry commented Dec 11, 2016

import scala.concurrent.ExecutionContext.Implicits._

import upickle.default._
import upickle._
import autowire._

final case class NestedData(field1: Map[String, String], field2: Double)

sealed trait Result

final case class Result1(reason: String, suggestions: Seq[NestedData]) extends Result
final case class Result2() extends Result


trait MyApi {

  def rpcMethod(): Result

}

object MyServer extends autowire.Server[String, upickle.default.Reader, upickle.default.Writer]{
  def write[Result: Writer](r: Result) = upickle.default.write(r)
  def read[Result: Reader](p: String) = upickle.default.read[Result](p)

  val routes = route (??? : MyApi)
}
libraryDependencies += "com.lihaoyi" %% "autowire" % "0.2.6"

libraryDependencies += "com.lihaoyi" %% "upickle" % "0.4.3"
MyApi.scala:25: diverging implicit expansion for type upickle.default.Writer[T1]
starting with macro method macroW in trait LowPriX
  val routes = route (??? : MyApi)
                     ^
one error found
@torstenrudolf
Copy link

this seems to be rather a upickle issue?

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

2 participants