diff options
Diffstat (limited to 'tests/neg')
-rw-r--r-- | tests/neg/i1501.scala | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/neg/i1501.scala b/tests/neg/i1501.scala new file mode 100644 index 000000000..045f2be1d --- /dev/null +++ b/tests/neg/i1501.scala @@ -0,0 +1,18 @@ +class A { + def foo: Int = 1 +} + +trait B extends A + +abstract class D { + def foo: Int +} + +class C extends D with B // error: illegal trait inheritance +trait E extends D with B // error: illegal trait inheritance + +object Test { + def main(args: Array[String]): Unit = { + println(new C().foo) + } +} |