inheritance - When will scala ever return Any? -


i following scala course coursera taught martin odersky. giving brilliant examples return types , 1 thing puzzled me:

if(true) 1 else false // return anyval closest subtype of both primitive types 

i assume following:

if(true) tweet.comment("hello") else string("hello") // assume code return anyref 

however when scala ever return any? ever return any?

i don't know scala, based on examples,

if(true) 1 else "hello" 

should trick.


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -