We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This test case currently fails:
object Mapper { class MapTo[A, B](val f: A => B) inline def mapOne[X](x: X) = implicit match { case m: MapTo[X, y] => m.f(x) } inline def mapTuple[Xs <: Tuple](xs: Xs) <: Tuple = xs match { case xs: (x1 *: xs1) => implicit match { case m: MapTo[`x1`, y] => m.f(xs.head.asInstanceOf[x1]) *: mapTuple(xs.tail : xs1) } case () => () } } object Test extends App { import Mapper._ val xs = (1, "hello") locally { implicit val i1: MapTo[Int, Double] = new MapTo[Int, Double](_.toDouble) implicit val i2: MapTo[String, Boolean] = new MapTo[String, Boolean](_.length > 3) val r1 = mapOne[X = Int](1) val r2 = mapTuple(xs) } }
The problem is that in the type pattern MapTo[X, y] of the implicit match case
MapTo[X, y]
case m: MapTo[X, y] => m.f(x)
the y is bound to a GADT bound TypeRef. But the implicit search only knows how to constrain TypeParamRefs.
y
TypeRef
TypeParamRefs
Hopefully, we get closer to a solution by identifying GADT bound and constrained variables.
The text was updated successfully, but these errors were encountered:
abgruszecki
No branches or pull requests
This test case currently fails:
The problem is that in the type pattern
MapTo[X, y]
of the implicit match casethe
y
is bound to a GADT boundTypeRef
. But the implicit search only knows how to constrainTypeParamRefs
.Hopefully, we get closer to a solution by identifying GADT bound and constrained variables.
The text was updated successfully, but these errors were encountered: