How does ’20 seconds’ work in Scala?

There are a few things going on. First, Scala allows dots and parens to be omitted from many method calls, so 20 seconds is equivalent to 20.seconds()*. Second, an “implicit conversion” is applied. Since 20 is an Int and Int has no seconds method, the compiler searches for an implicit conversion that takes an Int … Read more