blob: d44defbb9ec1d5edeff9175a8fe9760857fc2256 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
object Test {
def foo(o: Option[Int]): Int = {
lazy val i: Int = {
def local: Int = {if ("".isEmpty) return 42; -42}
assert(local == 42)
o.getOrElse(return -1)
}
i + 1
}
def main(args: Array[String]) {
assert(foo(None) == -1)
}
}
|