summaryrefslogtreecommitdiff
path: root/test/files/neg/t2462b.check
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2010-08-20 14:48:12 +0000
committerAdriaan Moors <adriaan.moors@epfl.ch>2010-08-20 14:48:12 +0000
commite11cac6ecc3c8791be3a37fc3b9f6837c9d46d23 (patch)
treedfa0ddc52703125288c6d7a85c4dc7befdb1508c /test/files/neg/t2462b.check
parentd4645f93728ee8cb40a17c23f92a272e27052889 (diff)
downloadscala-e11cac6ecc3c8791be3a37fc3b9f6837c9d46d23.tar.gz
scala-e11cac6ecc3c8791be3a37fc3b9f6837c9d46d23.tar.bz2
scala-e11cac6ecc3c8791be3a37fc3b9f6837c9d46d23.zip
closes 2462. better implicit error messages.
@implicitNotFound(msg="Custom error message that may refer to type parameters ${T} and ${U}") trait Constraint[T, U] whenever an implicit argument of type Constraint[A, B] cannot be found, the custom error message will be used, where the type arguments are interpolated in the obvious way note: if the msg in the annotation references non-existing type params, a warning is emitted the patch also cleans up annotation argument retrieval (moved it to AnnotationInfo from Symbol) review by odersky
Diffstat (limited to 'test/files/neg/t2462b.check')
-rw-r--r--test/files/neg/t2462b.check14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/files/neg/t2462b.check b/test/files/neg/t2462b.check
new file mode 100644
index 0000000000..ac9563878c
--- /dev/null
+++ b/test/files/neg/t2462b.check
@@ -0,0 +1,14 @@
+implicitNotFound_syntax.scala:6: warning: Invalid implicitNotFound message for trait Meh in package test:
+The type parameters Too, Elem referenced in the message of the @implicitNotFound annotation are not defined by trait Meh.
+trait Meh[-From, +To]
+ ^
+implicitNotFound_syntax.scala:9: warning: Invalid implicitNotFound message for trait Meh2 in package test:
+The type parameter Elem referenced in the message of the @implicitNotFound annotation is not defined by trait Meh2.
+trait Meh2[-From, +To]
+ ^
+implicitNotFound_syntax.scala:12: error: overriding method x in class thankyoupartest of type => Int;
+ method x needs `override' modifier
+class testmustfail extends thankyoupartest { def x = 43 }
+ ^
+two warnings found
+one error found