diff options
author | Dmitry Petrashko <dark@d-d.me> | 2016-03-24 20:22:01 +0100 |
---|---|---|
committer | Dmitry Petrashko <dark@d-d.me> | 2016-03-24 20:22:01 +0100 |
commit | 035aff45e89084290b8f67ca49007c3eac00f13f (patch) | |
tree | da73d918daf133ad8ff012a0774eb82fd49bf413 /tests/run | |
parent | 3e43c7f989c48c8e78eb6c7b5ae9bcb301a0c07d (diff) | |
parent | 28a2c76952c753ea2c3efacfad93c87a63227259 (diff) | |
download | dotty-035aff45e89084290b8f67ca49007c3eac00f13f.tar.gz dotty-035aff45e89084290b8f67ca49007c3eac00f13f.tar.bz2 dotty-035aff45e89084290b8f67ca49007c3eac00f13f.zip |
Merge pull request #1104 from dotty-staging/spec-bugs
Improvements & bugs that were discovered while implementing specialization.
Diffstat (limited to 'tests/run')
-rw-r--r-- | tests/run/no-useless-forwarders.scala | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/run/no-useless-forwarders.scala b/tests/run/no-useless-forwarders.scala new file mode 100644 index 000000000..699295027 --- /dev/null +++ b/tests/run/no-useless-forwarders.scala @@ -0,0 +1,17 @@ +trait A { + def foo(a: Int): Int = a + def bar(a: Int): Int +} + +trait B { + def bar(a: Int): Int = a +} + +object Test extends A with B{ + def main(args: Array[String]) = { + assert(!this.getClass.getDeclaredMethods.exists{x: java.lang.reflect.Method => x.getName == "foo"}, + "no forwarder is needed here") + assert(!this.getClass.getDeclaredMethods.exists{x: java.lang.reflect.Method => x.getName == "bar"}, + "no forwarder is needed here") + } +} |