diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2010-08-20 14:48:12 +0000 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2010-08-20 14:48:12 +0000 |
commit | e11cac6ecc3c8791be3a37fc3b9f6837c9d46d23 (patch) | |
tree | dfa0ddc52703125288c6d7a85c4dc7befdb1508c /src/compiler/scala/tools/nsc/symtab/Definitions.scala | |
parent | d4645f93728ee8cb40a17c23f92a272e27052889 (diff) | |
download | scala-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 'src/compiler/scala/tools/nsc/symtab/Definitions.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/Definitions.scala | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Definitions.scala b/src/compiler/scala/tools/nsc/symtab/Definitions.scala index d9e453291f..dbf95f9ac2 100644 --- a/src/compiler/scala/tools/nsc/symtab/Definitions.scala +++ b/src/compiler/scala/tools/nsc/symtab/Definitions.scala @@ -124,6 +124,7 @@ trait Definitions extends reflect.generic.StandardDefinitions { lazy val TailrecClass = getClass("scala.annotation.tailrec") lazy val SwitchClass = getClass("scala.annotation.switch") lazy val ElidableMethodClass = getClass("scala.annotation.elidable") + lazy val ImplicitNotFoundClass = getClass("scala.annotation.implicitNotFound") lazy val FieldTargetClass = getClass("scala.annotation.target.field") lazy val GetterTargetClass = getClass("scala.annotation.target.getter") lazy val SetterTargetClass = getClass("scala.annotation.target.setter") |