Permalink
Browse files

Merge pull request #23 from bowmanb/master

fix for Issue #19: Overloading methods example raises exception using scala 2.9.1
  • Loading branch information...
2 parents 3c5ef2d + cba8720 commit 7f5d90969f70a4154781c660041f205e51fa2a4a @stuhood stuhood committed Mar 23, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 web/_posts/2011-05-01-lesson.textile
  2. +1 −1 web/_posts/2011-05-03-lesson.textile
@@ -314,7 +314,7 @@ h3. Overloading methods
<pre>
class EvenMoreScientificCalculator(brand: String) extends ScientificCalculator(brand) {
- def log(m: Int) = log(m, math.exp(1))
+ def log(m: Int): Double = log(m, math.exp(1))
}
</pre>
@@ -132,7 +132,7 @@ A first instinct might be to do something conditionally based on the <code>isDef
<code>
// We want to multiply the number by two, otherwise return 0.
-val result = if (res1.isDefined()) {
+val result = if (res1.isDefined) {
res1.get * 2
} else {
0

0 comments on commit 7f5d909

Please sign in to comment.