diff options
author | Martin Odersky <odersky@gmail.com> | 2015-04-12 18:05:11 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-04-13 16:05:12 +0200 |
commit | 04eea24326c3a42ad908fe45e204af41b880f2cd (patch) | |
tree | 54ef40e919a1a4c1df25f0872c998979f4135811 /tests | |
parent | d4dc78c3ebe4e8b559c3a85b6b77c321b239bb90 (diff) | |
download | dotty-04eea24326c3a42ad908fe45e204af41b880f2cd.tar.gz dotty-04eea24326c3a42ad908fe45e204af41b880f2cd.tar.bz2 dotty-04eea24326c3a42ad908fe45e204af41b880f2cd.zip |
Self type inheritance check
Check that the self type of a class conforms to the self types of its parent classes.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/neg/selfInheritance.scala | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/neg/selfInheritance.scala b/tests/neg/selfInheritance.scala new file mode 100644 index 000000000..5f61c5bbb --- /dev/null +++ b/tests/neg/selfInheritance.scala @@ -0,0 +1,28 @@ +trait T { self: B => } + +abstract class A { self: B => + +} + +class B extends A with T { +} + +class C { self: B => + +} + +class D extends A // error + +class E extends T // error + +object Test { + + new B() {} + + new A() {} // error + + object O extends A // error + + object M extends C // error + +} |