Overloading methods example raises exception using scala 2.9.1
fourk opened this issue · 1 comments
fourk commented
Using scala 2.9.1 and sbt 0.11.2, the example with the title 'Overloading methods' on basics section does not work as documented.
scala> class ScientificCalculator(brand: String) extends Calculator(brand) {
| def log(m: Double, base: Double) = math.log(m) / math.log(base)
| }
defined class ScientificCalculator
scala> class EvenMoreScientificCalculator(brand: String) extends ScientificCalculator(brand) {
| def log(m: Int) = log(m, math.exp(1))
| }
<console>:10: error: overloaded method log needs result type
def log(m: Int) = log(m, math.exp(1))
lahosken commented
Looks like that fixed it.