diff options
author | Nicolas Stucki <nicolas.stucki@gmail.com> | 2016-07-05 10:50:47 +0200 |
---|---|---|
committer | Nicolas Stucki <nicolas.stucki@gmail.com> | 2016-07-13 10:30:12 +0200 |
commit | 468ff9c0fd341395d39eb57959755fb718990035 (patch) | |
tree | 4fcdbb476adc8772c70a80e370a0be3786287669 /tests | |
parent | bef40b45f6c15bf55fa73ea7923cb4da74cf77d0 (diff) | |
download | dotty-468ff9c0fd341395d39eb57959755fb718990035.tar.gz dotty-468ff9c0fd341395d39eb57959755fb718990035.tar.bz2 dotty-468ff9c0fd341395d39eb57959755fb718990035.zip |
Fix #1209: Skip redundant superclasses\supertraits.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/run/redundantParents.check | 8 | ||||
-rw-r--r-- | tests/run/redundantParents.scala | 30 |
2 files changed, 38 insertions, 0 deletions
diff --git a/tests/run/redundantParents.check b/tests/run/redundantParents.check new file mode 100644 index 000000000..4c7e367ce --- /dev/null +++ b/tests/run/redundantParents.check @@ -0,0 +1,8 @@ +C1 super class: class java.lang.Object +C1 interfaces: List(interface T2) +C2 super class: class C1 +C2 interfaces: List(interface T4, interface T5) +C3 super class: class C1 +C3 interfaces: List(interface T5) +C4 super class: class C2 +C4 interfaces: List() diff --git a/tests/run/redundantParents.scala b/tests/run/redundantParents.scala new file mode 100644 index 000000000..0cd277bbb --- /dev/null +++ b/tests/run/redundantParents.scala @@ -0,0 +1,30 @@ + +trait T1 +trait T2 extends T1 +trait T3 extends T2 +trait T4 extends T3 + +trait T5 + +class C1 extends T2 +class C2 extends C1 with T4 with T5 with T1 with T2 +class C3 extends C1 with T5 +class C4 extends C2 with T5 + +object Test { + def main(args: Array[String]): Unit = { + val c1 = (new C1).getClass + val c2 = (new C2).getClass + val c3 = (new C3).getClass + val c4 = (new C4).getClass + + println("C1 super class: " + c1.getSuperclass) + println("C1 interfaces: " + c1.getInterfaces.toList) + println("C2 super class: " + c2.getSuperclass) + println("C2 interfaces: " + c2.getInterfaces.toList) + println("C3 super class: " + c3.getSuperclass) + println("C3 interfaces: " + c3.getInterfaces.toList) + println("C4 super class: " + c4.getSuperclass) + println("C4 interfaces: " + c4.getInterfaces.toList) + } +} |