diff options
author | Hubert Plociniczak <hubert.plociniczak@epfl.ch> | 2010-11-02 00:14:58 +0000 |
---|---|---|
committer | Hubert Plociniczak <hubert.plociniczak@epfl.ch> | 2010-11-02 00:14:58 +0000 |
commit | b9982a3d3d338d097fbee082c5f6778f6494f5cd (patch) | |
tree | 872b3ecb57a53490bd689fa6643474affad5eb62 /test | |
parent | 62614a6f9f7c335cf53f464ce272ac05979f5647 (diff) | |
download | scala-b9982a3d3d338d097fbee082c5f6778f6494f5cd.tar.gz scala-b9982a3d3d338d097fbee082c5f6778f6494f5cd.tar.bz2 scala-b9982a3d3d338d097fbee082c5f6778f6494f5cd.zip |
Closes #3932, #1537. Review by extempore
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/t1537.check | 2 | ||||
-rw-r--r-- | test/files/run/t1537.scala | 18 | ||||
-rw-r--r-- | test/files/run/t3932.check | 6 | ||||
-rw-r--r-- | test/files/run/t3932.scala | 35 |
4 files changed, 61 insertions, 0 deletions
diff --git a/test/files/run/t1537.check b/test/files/run/t1537.check new file mode 100644 index 0000000000..0be5d980da --- /dev/null +++ b/test/files/run/t1537.check @@ -0,0 +1,2 @@ +true +true
\ No newline at end of file diff --git a/test/files/run/t1537.scala b/test/files/run/t1537.scala new file mode 100644 index 0000000000..9776f4a279 --- /dev/null +++ b/test/files/run/t1537.scala @@ -0,0 +1,18 @@ +trait Syntax { + object Foo +} + +trait Evaluation { + val syntax: Syntax + + def equalInTrait = this.syntax.Foo == this.syntax.Foo +} + +object Test extends Evaluation with Application { + object syntax extends Syntax + + def equalInObject = this.syntax.Foo == this.syntax.Foo + + println(equalInTrait) + println(equalInObject) +} diff --git a/test/files/run/t3932.check b/test/files/run/t3932.check new file mode 100644 index 0000000000..5ec39bbdeb --- /dev/null +++ b/test/files/run/t3932.check @@ -0,0 +1,6 @@ +true +true +true +true +true +true diff --git a/test/files/run/t3932.scala b/test/files/run/t3932.scala new file mode 100644 index 0000000000..f577ef8315 --- /dev/null +++ b/test/files/run/t3932.scala @@ -0,0 +1,35 @@ +class Foo + +abstract class C { + val f: Foo + def g1 = (f == f) +} +object O1 extends C { + val f = new Foo() + def g2 = (f == f) +} +object O2 extends C { + object f extends Foo + def g2 = (f == f) +} + +class O3 extends C { + object f extends Foo + def g2 = (f == f) +} + + +object Test { + def main(args: Array[String]): Unit = { + println(O1.g1) + println(O1.g2) + + println(O2.g1) + println(O2.g2) + + val o3 = new O3() + println(o3.g1) + println(o3.g2) + + } +} |