From da22a43cc0210363e4aea47fbc06075248f333d7 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Fri, 7 Nov 2014 20:03:02 +1000 Subject: 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 --- test/files/run/t1994.scala | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/files/run/t1994.scala (limited to 'test/files/run/t1994.scala') 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) + } +} -- cgit v1.2.3