diff options
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/t8219-any-any-ref-equals.check | 10 | ||||
-rw-r--r-- | test/files/neg/t8219-any-any-ref-equals.scala | 8 |
2 files changed, 18 insertions, 0 deletions
diff --git a/test/files/neg/t8219-any-any-ref-equals.check b/test/files/neg/t8219-any-any-ref-equals.check new file mode 100644 index 0000000000..95d2536fba --- /dev/null +++ b/test/files/neg/t8219-any-any-ref-equals.check @@ -0,0 +1,10 @@ +t8219-any-any-ref-equals.scala:5: error: method ==: (x$1: Any)Boolean does not take type parameters. + "".==[Int] + ^ +t8219-any-any-ref-equals.scala:6: error: method ==: (x$1: Any)Boolean does not take type parameters. + ("": AnyRef).==[Int] + ^ +t8219-any-any-ref-equals.scala:7: error: method ==: (x$1: Any)Boolean does not take type parameters. + ("": Object).==[Int] + ^ +three errors found diff --git a/test/files/neg/t8219-any-any-ref-equals.scala b/test/files/neg/t8219-any-any-ref-equals.scala new file mode 100644 index 0000000000..f1b81fa734 --- /dev/null +++ b/test/files/neg/t8219-any-any-ref-equals.scala @@ -0,0 +1,8 @@ +object Test { + // The error message tells us that AnyRef#== and Any#== are overloaded. + // A real class couldn't define such an overload, why do we allow AnyRef + // to do so? + "".==[Int] + ("": AnyRef).==[Int] + ("": Object).==[Int] +} |