diff options
Diffstat (limited to 'test/files/neg/override-object-no.check')
-rw-r--r-- | test/files/neg/override-object-no.check | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/files/neg/override-object-no.check b/test/files/neg/override-object-no.check new file mode 100644 index 0000000000..c509634b3f --- /dev/null +++ b/test/files/neg/override-object-no.check @@ -0,0 +1,23 @@ +override-object-no.scala:14: error: overriding object Bar in trait Foo with object Bar in trait Foo2: +an overriding object must conform to the overridden object's class bound; + found : case1.Bippy with ScalaObject + required: case1.Bippy with case1.Bippo with ScalaObject + override object Bar extends Bippy { // err + ^ +override-object-no.scala:21: error: overriding object Bar in trait Quux1 with object Bar in trait Quux2: +an overriding object must conform to the overridden object's class bound; + found : java.lang.Object with ScalaObject{def g: java.lang.String} + required: java.lang.Object with ScalaObject{def g: Int} + trait Quux2 extends Quux1 { override object Bar { def g = "abc" } } // err + ^ +override-object-no.scala:25: error: overriding object Bar in trait Quux3 of type object Quux4.this.Bar; + object Bar cannot override final member + trait Quux4 extends Quux3 { override object Bar } // err + ^ +override-object-no.scala:43: error: overriding object A in class Foo with object A in class P2: +an overriding object must conform to the overridden object's class bound; + found : case2.Bar[List[String]] with ScalaObject + required: case2.Bar[Traversable[String]] with ScalaObject + override object A extends Bar[List[String]] // err + ^ +four errors found |