We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1a83575 commit b8c0478Copy full SHA for b8c0478
tests/run/no-useless-forwarders.scala
@@ -0,0 +1,17 @@
1
+trait A {
2
+ def foo(a: Int): Int = a
3
+ def bar(a: Int): Int
4
+}
5
+
6
+trait B {
7
+ def bar(a: Int): Int = a
8
9
10
+object Test extends A with B{
11
+ def main(args: Array[String]) = {
12
+ assert(!this.getClass.getDeclaredMethods.exists{x: java.lang.reflect.Method => x.getName == "foo"},
13
+ "no forwarder is needed here")
14
+ assert(!this.getClass.getDeclaredMethods.exists{x: java.lang.reflect.Method => x.getName == "bar"},
15
16
+ }
17
0 commit comments