From 9d9ae0a6126933200bef7c2ce4da7d1f86e46607 Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Mon, 7 May 2012 23:56:06 +0200 Subject: tests for SI-5726 --- test/pending/run/t5726a.scala | 17 +++++++++++++++++ test/pending/run/t5726b.scala | 16 ++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 test/pending/run/t5726a.scala create mode 100644 test/pending/run/t5726b.scala (limited to 'test/pending/run') diff --git a/test/pending/run/t5726a.scala b/test/pending/run/t5726a.scala new file mode 100644 index 0000000000..24d828a159 --- /dev/null +++ b/test/pending/run/t5726a.scala @@ -0,0 +1,17 @@ +import language.dynamics + +class DynamicTest extends Dynamic { + def selectDynamic(name: String) = s"value of $name" + def updateDynamic(name: String)(value: Any) { + println(s"You have just updated property '$name' with value: $value") + } +} + +object MyApp extends App { + def testing() { + val test = new DynamicTest + test.firstName = "John" + } + + testing() +} \ No newline at end of file diff --git a/test/pending/run/t5726b.scala b/test/pending/run/t5726b.scala new file mode 100644 index 0000000000..839dcf40b5 --- /dev/null +++ b/test/pending/run/t5726b.scala @@ -0,0 +1,16 @@ +import language.dynamics + +class DynamicTest extends Dynamic { + def updateDynamic(name: String)(value: Any) { + println(s"You have just updated property '$name' with value: $value") + } +} + +object MyApp extends App { + def testing() { + val test = new DynamicTest + test.firstName = "John" + } + + testing() +} \ No newline at end of file -- cgit v1.2.3 From 8d8b2caa95a5cb1b2a30b63c35b0a8a5ab25012c Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Mon, 7 May 2012 23:58:24 +0200 Subject: test for SI-5722 --- test/pending/run/t5722.scala | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 test/pending/run/t5722.scala (limited to 'test/pending/run') diff --git a/test/pending/run/t5722.scala b/test/pending/run/t5722.scala new file mode 100644 index 0000000000..21ace060d6 --- /dev/null +++ b/test/pending/run/t5722.scala @@ -0,0 +1,6 @@ +object Test extends App { + def foo[T: ClassTag] = println(classOf[T]) + foo[Int] + foo[Array[Int]] + foo[List[Int]] +} \ No newline at end of file -- cgit v1.2.3 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 (limited to 'test/pending/run') 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 From 3830947c94294b79190d024218746e40193e7e6b Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Tue, 8 May 2012 01:00:40 +0200 Subject: test for SI-4728 --- test/pending/run/t4728.check | 2 ++ test/pending/run/t4728.scala | 11 +++++++++++ 2 files changed, 13 insertions(+) create mode 100644 test/pending/run/t4728.check create mode 100644 test/pending/run/t4728.scala (limited to 'test/pending/run') diff --git a/test/pending/run/t4728.check b/test/pending/run/t4728.check new file mode 100644 index 0000000000..7a754f414c --- /dev/null +++ b/test/pending/run/t4728.check @@ -0,0 +1,2 @@ +1 +2 \ No newline at end of file diff --git a/test/pending/run/t4728.scala b/test/pending/run/t4728.scala new file mode 100644 index 0000000000..36f7860613 --- /dev/null +++ b/test/pending/run/t4728.scala @@ -0,0 +1,11 @@ +class X +class Y extends X +object Ambiguous { + def f(x: X) = 1 + def f(ys: Y*) = 2 +} + +object Test extends App { + println(Ambiguous.f(new X)) + println(Ambiguous.f(new Y)) +} \ No newline at end of file -- cgit v1.2.3 From a48f82663b11193095fd6c836b5e78790b4778fe Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Tue, 8 May 2012 01:24:29 +0200 Subject: test for SI-4560 --- test/pending/run/t4560.scala | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 test/pending/run/t4560.scala (limited to 'test/pending/run') diff --git a/test/pending/run/t4560.scala b/test/pending/run/t4560.scala new file mode 100644 index 0000000000..fe62136319 --- /dev/null +++ b/test/pending/run/t4560.scala @@ -0,0 +1,9 @@ +trait B { + this: Test.type => + + def y = new { def f() = () } + def fail() = y.f() +} +object Test extends B { + def main(args: Array[String]): Unit = fail() +} \ No newline at end of file -- cgit v1.2.3