aboutsummaryrefslogtreecommitdiff
path: root/tests/run/redundantParents.scala
diff options
context:
space:
mode:
authorNicolas Stucki <nicolas.stucki@gmail.com>2016-07-05 10:50:47 +0200
committerNicolas Stucki <nicolas.stucki@gmail.com>2016-07-13 10:30:12 +0200
commit468ff9c0fd341395d39eb57959755fb718990035 (patch)
tree4fcdbb476adc8772c70a80e370a0be3786287669 /tests/run/redundantParents.scala
parentbef40b45f6c15bf55fa73ea7923cb4da74cf77d0 (diff)
downloaddotty-468ff9c0fd341395d39eb57959755fb718990035.tar.gz
dotty-468ff9c0fd341395d39eb57959755fb718990035.tar.bz2
dotty-468ff9c0fd341395d39eb57959755fb718990035.zip
Fix #1209: Skip redundant superclasses\supertraits.
Diffstat (limited to 'tests/run/redundantParents.scala')
-rw-r--r--tests/run/redundantParents.scala30
1 files changed, 30 insertions, 0 deletions
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)
+ }
+}