One weird trick to make all your #scala program compile
implicit class XtensionBang[A](a: A) {
def unary_![B]: B = a.asInstanceOf[B]
}
-
-
Why not just go straight to ‘Nothing’?
1 reply 0 retweets 0 likes -
Replying to @FelixHargreaves @gabro27
That would crash > 1.asInstanceOf[Nothing] java.lang.ClassCastException: java.lang.Integer cannot be cast to scala.runtime.Nothing$
2 replies 0 retweets 0 likes
This is not a defence... ;)
4:25 AM - 22 Oct 2017
from East Worldham, England
0 replies
0 retweets
2 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.