diff options
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/override.check | 5 | ||||
-rwxr-xr-x | test/files/neg/override.scala | 15 |
2 files changed, 20 insertions, 0 deletions
diff --git a/test/files/neg/override.check b/test/files/neg/override.check new file mode 100644 index 0000000000..0336fb2b11 --- /dev/null +++ b/test/files/neg/override.check @@ -0,0 +1,5 @@ +override.scala:9: error: overriding type T in trait A with bounds >: Int <: Int; + type T in trait B with bounds >: String <: String has incompatible type + lazy val x : A with B = x + ^ +one error found diff --git a/test/files/neg/override.scala b/test/files/neg/override.scala new file mode 100755 index 0000000000..764b06603a --- /dev/null +++ b/test/files/neg/override.scala @@ -0,0 +1,15 @@ +trait X { + trait A { type T >: Int <: Int } + val x : A + var n : x.T = 3 +} + +trait Y extends X { + trait B { type T >: String <: String } + lazy val x : A with B = x + n = "foo" +} + +object Test extends Application { + new Y {} +} |