summaryrefslogtreecommitdiff
path: root/test/files/run/t1994.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2014-11-07 20:03:02 +1000
committerJason Zaugg <jzaugg@gmail.com>2014-11-07 20:03:02 +1000
commitda22a43cc0210363e4aea47fbc06075248f333d7 (patch)
tree341326e7a7fcb101e3fefbbe9ab721c59bc7221a /test/files/run/t1994.scala
parentced9e167d9d2c9016e76b6db94ceea7335d37bf2 (diff)
downloadscala-da22a43cc0210363e4aea47fbc06075248f333d7.tar.gz
scala-da22a43cc0210363e4aea47fbc06075248f333d7.tar.bz2
scala-da22a43cc0210363e4aea47fbc06075248f333d7.zip
SI-1994 Test case for fixed overriding problem
The test case passes since Scala 2.9.2. Prior, it failed with: ~/scala/2.9.1/bin/scalac sandbox/t1994.scala sandbox/t1994.scala:9: error: method y overrides nothing override def y = 1 ^ one error found
Diffstat (limited to 'test/files/run/t1994.scala')
-rw-r--r--test/files/run/t1994.scala20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/files/run/t1994.scala b/test/files/run/t1994.scala
new file mode 100644
index 0000000000..0b463e3444
--- /dev/null
+++ b/test/files/run/t1994.scala
@@ -0,0 +1,20 @@
+class A {
+ protected def x = 0
+ protected[A] def y = 0
+}
+
+class B extends A {
+ override def x = 1
+ def superY = super[A].y
+ override def y = 1
+}
+
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ val b = new B
+ assert(b.x == 1)
+ assert(b.y == 1)
+ assert(b.superY == 0)
+ }
+}