diff options
author | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2014-02-09 23:06:17 +0100 |
---|---|---|
committer | Grzegorz Kossakowski <grzegorz.kossakowski@gmail.com> | 2014-02-09 23:06:17 +0100 |
commit | 73784d78fdbd4feb07a8446a8336dd203c1be866 (patch) | |
tree | 5a3b59cd2f16730b4d307669eec3b1e66dd51dc1 /test/files/run | |
parent | 08a30e89ef10f1ef9f29b754b61ca7593d475f64 (diff) | |
parent | 46d84194a46033f945f9cfc7c4f61f52b0c3ae9e (diff) | |
download | scala-73784d78fdbd4feb07a8446a8336dd203c1be866.tar.gz scala-73784d78fdbd4feb07a8446a8336dd203c1be866.tar.bz2 scala-73784d78fdbd4feb07a8446a8336dd203c1be866.zip |
Merge pull request #3488 from retronym/ticket/8245
SI-8245 Fix regression in interplay between lazy val, return
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/t8245.scala | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/files/run/t8245.scala b/test/files/run/t8245.scala new file mode 100644 index 0000000000..d44defbb9e --- /dev/null +++ b/test/files/run/t8245.scala @@ -0,0 +1,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) + } +} |