Permalink
Browse files

test for SI-5610

  • Loading branch information...
xeno-by committed May 7, 2012
1 parent 7cac633 commit 8e7d3bef6d995a7d40054df8f2ca2ab0c285ce7f
Showing with 42 additions and 0 deletions.
  1. +1 −0 test/pending/run/t5610a.check
  2. +19 −0 test/pending/run/t5610a.scala
  3. +1 −0 test/pending/run/t5610b.check
  4. +21 −0 test/pending/run/t5610b.scala
@@ -0,0 +1 @@
Stroke a kitten
@@ -0,0 +1,19 @@
object Test extends App {
class Result(_str: => String) {
lazy val str = _str
}
def foo(str: => String)(i: Int) = new Result(str)
def bar(f: Int => Result) = f(42)
var test: String = null
val result = bar(foo(test))
test = "bar"
if (result.str == null) {
println("Destroy ALL THE THINGS!!!")
} else {
println("Stroke a kitten")
}
}
@@ -0,0 +1 @@
Stroke a kitten
@@ -0,0 +1,21 @@
object Bug {
def main(args: Array[String]) {
var test: String = null
val result = bar(foo(test))
test = "bar"
if (result.str == null) {
println("Destroy ALL THE THINGS!!!")
} else {
println("Stroke a kitten")
}
}
class Result(_str: => String) {
lazy val str = _str
}
def foo(str: => String)(i: Int) = new Result(str)
def bar(f: Int => Result) = f(42)
}

0 comments on commit 8e7d3be

Please sign in to comment.