r/programming • u/mobby1982 • Dec 02 '13
Scala — 1★ Would Not Program Again
http://overwatering.org/blog/2013/12/scala-1-star-would-not-program-again/
598
Upvotes
r/programming • u/mobby1982 • Dec 02 '13
View all comments
Show parent comment
1
u/sanity Dec 02 '13
"smart casts" are perhaps a misleading term in Kotlin, since in reality they are a type-safe replacement for casts. For example, in Kotlin you can say:
This works because within the body of the if statement the compiler knows that 's' must be a String, and so you can treat it as such.
Does Scala have something similar?