This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Test { | |
def fn1(x: Int, y: Int = 5)(z: Int) = Some(x+y+z) | |
def fn2(x: Int)(y: Int) = Some(x+y) | |
def program = { | |
fn1(4) // why this compiles | |
fn2(2) // when this does not | |
5 | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fn1(x: Int, y: Int = 5)(z: Int) = Some(x+y+z) | |
def fn2(x: Int)(y: Int) = Some(x+y) | |
def program = | |
fn1(4) // why this compiles | |
fn2(2) // when this does not | |
5 |