Created
November 30, 2016 18:12
-
-
Save sellout/3bec3b9d3b6de2fd224daee5cf859ed6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait A[T] { | |
type F[_] | |
} | |
trait B1[T] extends A[T] | |
object B1 { | |
type Aux[T, Fʹ[_]] = B1[T] { type F[A] = Fʹ[A] } | |
} | |
trait B2[T] extends A[T] | |
object B2 { | |
type Aux[T, Fʹ[_]] = B2[T] { type F[A] = Fʹ[A] } | |
} | |
trait C[T] extends B1[T] with B2[T] | |
object C { | |
type Aux[T, Fʹ[_]] = C[T] { type F[A] = Fʹ[A] } | |
} | |
object Test { | |
def b1[T, F[_]](implicit ev: B1.Aux[T, F]): Unit = () | |
def b2[T, F[_]](implicit ev: B2.Aux[T, F]): Unit = () | |
def c[T, F[_]](implicit ev: C.Aux[T, F]): (Unit, Unit) = (b1, b2) | |
} | |
// [error] abstractTypeClass.scala:28: could not find implicit value for parameter ev: B1.Aux[T,F] | |
// [error] def c[T, F[_]](implicit ev: C.Aux[T, F]): (Unit, Unit) = (b1, b1) | |
// [error] ^ | |
// [error] abstractTypeClass.scala:28: could not find implicit value for parameter ev: B2.Aux[T,F] | |
// [error] def c[T, F[_]](implicit ev: C.Aux[T, F]): (Unit, Unit) = (b1, b2) | |
// [error] ^ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If I try to pass
ev
explicitly, I get the following:“type F has one type parameter, but type F has one” is an interesting error …