Created
March 23, 2010 18:05
-
-
Save retronym/341475 to your computer and use it in GitHub Desktop.
Calculate the Least Upper Bound of two types.
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
object test { | |
case class L[A, B]() { | |
def ToLub[AA >: A <: L, BB >: B <: L, L] = new { type LUB = L } | |
} | |
val intBoolLub = L[Int, Boolean].ToLub | |
(1: AnyVal) : intBoolLub.LUB | |
1: intBoolLub.LUB | |
true: intBoolLub.LUB | |
0L: intBoolLub.LUB | |
// | |
// "": intBoolLub.LUB | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Same problem as here
akka/akka#19418