Name: Anonymous 2013-09-23 13:49
I started with scala last weak, already feal that this is the sepples of java.
any ho, just thought some master singer may tell me, why is this compiling w/o a peap? Or isthere a
any ho, just thought some master singer may tell me, why is this compiling w/o a peap? Or isthere a
-unchecked++ option i dont now about?class Couch
class Chair
class C[+T](val t : T)
object C {
def apply[T](x : T) : C[T] = new C(x)
def unapply[T](x : C[T]) : Option[T] = Some(x.t)
def reinterpret_cast[T](x : Any) : T = {
val C(C(t)) : C[C[T]] = C(C(x))
t
}
}
object main {
def main(args : Array[String]) {
val s = C.reinterpret_cast[Chair](new Couch)
}
}