Last active
December 14, 2015 10:29
-
-
Save eparejatobes/5072626 to your computer and use it in GitHub Desktop.
Image of a type constructor; compiler crashes, probably related with https://issues.scala-lang.org/browse/SI-5559
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 ImageOfAux { | |
type F[_] | |
type A | |
type FA | |
} | |
trait ImageOf[FA0, F0[_]] extends ImageOfAux { | |
type F[_] = F0[_] | |
type FA = FA0 | |
type A | |
} | |
object ImageOf { | |
type img[F[_]] = { | |
type λ[FA] = ImageOf[FA,F] | |
} | |
implicit def inImage[F0[_], A0, FA0 <: F0[A0]]: | |
ImageOf[FA0, F0] = | |
new ImageOf[FA0,F0] { | |
type A = A0 | |
} | |
} | |
object Test { | |
import ImageOf._ | |
class HasList[S: img[List]#λ] {} | |
// compiler crashes here | |
// object stringList extends HasList[List[String]] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment