From 8e7d3bef6d995a7d40054df8f2ca2ab0c285ce7f Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Tue, 8 May 2012 00:01:53 +0200 Subject: test for SI-5610 --- test/pending/run/t5610a.check | 1 + test/pending/run/t5610a.scala | 19 +++++++++++++++++++ test/pending/run/t5610b.check | 1 + test/pending/run/t5610b.scala | 21 +++++++++++++++++++++ 4 files changed, 42 insertions(+) create mode 100644 test/pending/run/t5610a.check create mode 100644 test/pending/run/t5610a.scala create mode 100644 test/pending/run/t5610b.check create mode 100644 test/pending/run/t5610b.scala diff --git a/test/pending/run/t5610a.check b/test/pending/run/t5610a.check new file mode 100644 index 0000000000..2aa46b3b91 --- /dev/null +++ b/test/pending/run/t5610a.check @@ -0,0 +1 @@ +Stroke a kitten diff --git a/test/pending/run/t5610a.scala b/test/pending/run/t5610a.scala new file mode 100644 index 0000000000..f20b295762 --- /dev/null +++ b/test/pending/run/t5610a.scala @@ -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") + } +} \ No newline at end of file diff --git a/test/pending/run/t5610b.check b/test/pending/run/t5610b.check new file mode 100644 index 0000000000..2aa46b3b91 --- /dev/null +++ b/test/pending/run/t5610b.check @@ -0,0 +1 @@ +Stroke a kitten diff --git a/test/pending/run/t5610b.scala b/test/pending/run/t5610b.scala new file mode 100644 index 0000000000..d922d6333c --- /dev/null +++ b/test/pending/run/t5610b.scala @@ -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) +} \ No newline at end of file -- cgit v1.2.3