summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-02-22 06:38:20 -0800
committerPaul Phillips <paulp@improving.org>2013-02-22 06:38:20 -0800
commitd10626faf3ce0aa4ed6a7eacdd80d7ccd785e249 (patch)
tree6e0fcd85a88e23d0efd6f34dc3b04463f05c922d /test/files
parent35be8d34b3f1317ba0705d1efad5e7334e5ab44f (diff)
parent0eff6cd49d32c20d5648b57a01b5e80339a1cca7 (diff)
downloadscala-d10626faf3ce0aa4ed6a7eacdd80d7ccd785e249.tar.gz
scala-d10626faf3ce0aa4ed6a7eacdd80d7ccd785e249.tar.bz2
scala-d10626faf3ce0aa4ed6a7eacdd80d7ccd785e249.zip
Merge pull request #2141 from paulp/pr/overriding-methods
Fix and optimization in overriding logic.
Diffstat (limited to 'test/files')
-rw-r--r--test/files/run/all-overridden.check1
-rw-r--r--test/files/run/all-overridden.scala11
2 files changed, 12 insertions, 0 deletions
diff --git a/test/files/run/all-overridden.check b/test/files/run/all-overridden.check
new file mode 100644
index 0000000000..1b620b1176
--- /dev/null
+++ b/test/files/run/all-overridden.check
@@ -0,0 +1 @@
+method g
diff --git a/test/files/run/all-overridden.scala b/test/files/run/all-overridden.scala
new file mode 100644
index 0000000000..1b798ef748
--- /dev/null
+++ b/test/files/run/all-overridden.scala
@@ -0,0 +1,11 @@
+import scala.reflect.runtime.universe._
+
+object Test {
+ trait Foo { def f: Int = 5 ; def g: Int }
+ trait Bar extends Foo { def f: Int ; def g: Int = 5 }
+
+ def main(args: Array[String]): Unit = {
+ // We should see g, but not f or $init$.
+ typeOf[Bar].declarations.toList.flatMap(_.allOverriddenSymbols) foreach println
+ }
+}