diff options
author | Mathias <mathias@spray.cc> | 2011-07-19 11:00:03 +0200 |
---|---|---|
committer | Mathias <mathias@spray.cc> | 2011-07-19 11:00:03 +0200 |
commit | d10193d65b19ff977a30cd5de4aa7ba640e0f795 (patch) | |
tree | cd0dbca97db233a947e035babf7dc014941cb09a | |
parent | e83c48eaf7d0bb0b1809ef0258d8980ac08bcf53 (diff) | |
download | spray-json-d10193d65b19ff977a30cd5de4aa7ba640e0f795.tar.gz spray-json-d10193d65b19ff977a30cd5de4aa7ba640e0f795.tar.bz2 spray-json-d10193d65b19ff977a30cd5de4aa7ba640e0f795.zip |
Improve compile time error messages with @implicitNotFound annotations
-rw-r--r-- | src/main/scala/cc/spray/json/JsonFormat.scala | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main/scala/cc/spray/json/JsonFormat.scala b/src/main/scala/cc/spray/json/JsonFormat.scala index 0fedd3f..c5bc53e 100644 --- a/src/main/scala/cc/spray/json/JsonFormat.scala +++ b/src/main/scala/cc/spray/json/JsonFormat.scala @@ -17,9 +17,12 @@ package cc.spray.json +import annotation.implicitNotFound + /** * Provides the JSON deserialization for type T. */ +@implicitNotFound(msg = "Cannot find JsonReader or JsonFormat type class for ${T}") trait JsonReader[T] { def read(json: JsValue): T } @@ -33,6 +36,7 @@ object JsonReader { /** * Provides the JSON serialization for type T. */ +@implicitNotFound(msg = "Cannot find JsonWriter or JsonFormat type class for ${T}") trait JsonWriter[T] { def write(obj: T): JsValue } |