summaryrefslogtreecommitdiff
path: root/test/files/neg/t5617.scala
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2012-06-17 11:47:11 +0200
committerJason Zaugg <jzaugg@gmail.com>2012-06-17 11:55:12 +0200
commit2d3b6bd321724c565fd458a2bbffb4ad211c54ff (patch)
treed512a70ac2148ebec4b9528852357f6dacebd8ab /test/files/neg/t5617.scala
parent277dc7cf43566f8294bde4143107d9bfaa59e8e3 (diff)
downloadscala-2d3b6bd321724c565fd458a2bbffb4ad211c54ff.tar.gz
scala-2d3b6bd321724c565fd458a2bbffb4ad211c54ff.tar.bz2
scala-2d3b6bd321724c565fd458a2bbffb4ad211c54ff.zip
SI-5617 Better error message for "x overrides nothing".
"It looks like you're trying to override a method", notes Clippy.
Diffstat (limited to 'test/files/neg/t5617.scala')
-rw-r--r--test/files/neg/t5617.scala14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/files/neg/t5617.scala b/test/files/neg/t5617.scala
new file mode 100644
index 0000000000..41541b5e90
--- /dev/null
+++ b/test/files/neg/t5617.scala
@@ -0,0 +1,14 @@
+trait A {
+ def foo(i: Int)(b: String): Int
+ def foo(u: Unit): Int // not reported
+ def foo(x: Float): Int // not reported
+}
+trait B[X] extends A {
+ def foo(x: X): Int
+ def foo(u: Unit): Int
+ final def foo(x: Float): Int = 0 // not reported
+}
+trait C extends B[Boolean] {
+ override def foo(s: String): Int
+ val foo = 0 // not reported
+}