Duh Typing

Tags:

http://www.artima.com/weblogs/viewpost.jsp?thread=209353

Code snippet from Scala:

scala> val v = List("Hi ", "there!")
v: List[java.lang.String] = List(Hi , there!)

Why it is duh typing?

“Well, duh! The type of s is String.”

Very similar to c++0x’s auto keyword.