From e11cac6ecc3c8791be3a37fc3b9f6837c9d46d23 Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Fri, 20 Aug 2010 14:48:12 +0000 Subject: 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 --- test/files/neg/t2462a.check | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 test/files/neg/t2462a.check (limited to 'test/files/neg/t2462a.check') diff --git a/test/files/neg/t2462a.check b/test/files/neg/t2462a.check new file mode 100644 index 0000000000..b609ec519f --- /dev/null +++ b/test/files/neg/t2462a.check @@ -0,0 +1,4 @@ +implicitNotFound.scala:2: error: Cannot construct a collection of type List[String] with elements of type Int based on a collection of type List[String]. + List(1,2,3).map[Int, List[String]](x => 1) + ^ +one error found -- cgit v1.2.3