From d187a0ab9973a5e4042597a9dbf4f6d48ca482fe Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Tue, 11 Feb 2014 19:57:59 -0800 Subject: SI-261 private vals in traits depend on composition order Fix for SI-7475 in #3440 took care of this one. I nixed the old (redundant) test cases and replaced by a single run/ test, which didn't compile until. --- test/files/pos/t261-ab.scala | 9 --------- test/files/pos/t261-ba.scala | 9 --------- test/files/run/t261.check | 2 ++ test/files/run/t261.scala | 11 +++++++++++ 4 files changed, 13 insertions(+), 18 deletions(-) delete mode 100644 test/files/pos/t261-ab.scala delete mode 100644 test/files/pos/t261-ba.scala create mode 100644 test/files/run/t261.check create mode 100644 test/files/run/t261.scala (limited to 'test/files') diff --git a/test/files/pos/t261-ab.scala b/test/files/pos/t261-ab.scala deleted file mode 100644 index df641e811a..0000000000 --- a/test/files/pos/t261-ab.scala +++ /dev/null @@ -1,9 +0,0 @@ -trait A { val foo: String = "A" } -trait B { - private val foo: String = "B" - def f = println(foo) -} -object Test extends App with B with A { - println(foo) // prints "A", as expected - f // prints "B", as expected -} diff --git a/test/files/pos/t261-ba.scala b/test/files/pos/t261-ba.scala deleted file mode 100644 index 6c9c5b10b7..0000000000 --- a/test/files/pos/t261-ba.scala +++ /dev/null @@ -1,9 +0,0 @@ -trait B { - private val foo: String = "B" - def f = println(foo) -} -trait A { val foo: String = "A" } -object Test extends App with B with A { - println(foo) // prints "A", as expected - f // prints "B", as expected -} diff --git a/test/files/run/t261.check b/test/files/run/t261.check new file mode 100644 index 0000000000..35d242ba79 --- /dev/null +++ b/test/files/run/t261.check @@ -0,0 +1,2 @@ +A +B diff --git a/test/files/run/t261.scala b/test/files/run/t261.scala new file mode 100644 index 0000000000..d8ddb28c00 --- /dev/null +++ b/test/files/run/t261.scala @@ -0,0 +1,11 @@ +trait A { val foo: String = "A" } +trait B { + private val foo: String = "B" + def f = println(foo) +} +object Test extends A with B { + def main(args: Array[String]) = { + println(foo) + f + } +} \ No newline at end of file -- cgit v1.2.3