Hm no… can’t remember
-
-
-
Replying to @propensive @ktosopl
It was certainly a question
@djspiewak came up with for a Scala Days quiz one year... I have a feeling there might be another, though... I'm AFK. Do multiple returns parse?1 reply 0 retweets 1 like -
Replying to @propensive @djspiewak
lol, they do. This one I had not known I think, weird one :-)
1 reply 0 retweets 0 likes -
Replying to @ktosopl @djspiewak
Haha. Does a "return expression" typecheck as Nothing, then?
1 reply 0 retweets 0 likes -
That'd be weird, you could actually return a Nothing value, wouldn't you?
1 reply 0 retweets 1 like -
Well, plenty of other stuff typechecks as Nothing: - ??? - throw YourFavoriteException - def f: Nothing = f - yourFavoriteValue.asInstanceOf[Nothing] None of them really *return* Nothing, though...
1 reply 0 retweets 1 like -
Indeed, that's what I was going for - it'd be super weird if `return notNothing` typechecked as Nothing and kot throw :D
1 reply 0 retweets 0 likes -
But, to the typechecker, return is equivalent to an exception. I think it was even implemented under the hood by throwing an exception and catching it at the method boundary in early versions of Scala. (Maybe it still is!)
1 reply 0 retweets 1 like -
Sure, I just meant the case in which you'd actually be able to "hold" a Nothing
1 reply 0 retweets 1 like
Give me a Nothing and I'll be happy to hold it! ;)
-
-
Give me Nothing or give me def
1 reply 0 retweets 3 likes -
In this world Nothing can be said to be certain, except def syntaxes.
0 replies 2 retweets 3 likes
End of conversation
New conversation -
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.