Calling .asInstanceOf without a type parameter really is the filthiest trick I know.
-
-
Replying to @propensive
@propensive Yep! Who doesn’t want their cast to be determined by type inference?2 replies 0 retweets 0 likes -
Replying to @djspiewak
@djspiewak@propensive WTF!? And I thought I knew all the dark corners already... Does it always infer Nothing?3 replies 0 retweets 0 likes -
Replying to @oxnrtr
@oxnrtr@propensive val x: String = foo.asInstanceOf vs val y = foo.asInstanceOf1 reply 0 retweets 0 likes -
Replying to @djspiewak
@djspiewak@oxnrtr It's particularly useful when you know the complex part of the type will go away with erasure anyway.1 reply 0 retweets 0 likes -
Replying to @propensive
@propensive@djspiewak@oxnrtr Can't make it work in 2.10.2... What is supposed to be the trick?1 reply 0 retweets 0 likes -
Replying to @pedrofurla
@pedrofurla@propensive@djspiewak@oxnrtr can't find an example where the compiler doesn't infer Nothing, e.g. https://gist.github.com/SethTisue/6444477 …4 replies 0 retweets 0 likes
@SethTisue @pedrofurla @djspiewak @oxnrtr Though it was in macro code, so that's never going to fit in a tweet...
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.