3 ms·
Scala example is wrong, wouldn't even compile; should be: def blubExtra(a: Int, b: Int): Int = blub(inc(a), inc(b)) The original would need an equals thro
by virtualwhys 12y ago
Scala example is wrong, wouldn't even compile; should be:
def blubExtra(a: Int, b: Int): Int = blub(inc(a), inc(b))
The original would need an equals thrown in there, otherwise it's procedural syntax (IIRC, has been deprecated or will be in the next release) which has a return type of Unit, thus not compiling when specifying a return type of Int.
def blubExtra(a: Int, b: Int): Int = {
blub(inc(a), inc(b))
}
- afandian 12y agoThanks for the typo spot. I've not written Scala for about 5 years. Unfortunately I can't go back and edit my post.