Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Casting Couch in the Scala

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 -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)
        }
}

Name: Anonymous 2013-09-24 12:06

>>9
Welcome to 4chan, we hope you enjoy your stay.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List