Last active
December 12, 2015 04:49
-
-
Save stephanos/4717443 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import play.api.libs.json.Json | |
| case class MyClass(id: Int, text: String) | |
| object MyClass { | |
| implicit val mailRead = Json.reads[MyClass] | |
| def apply(id: Int) = | |
| apply(id, "") | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [error] exception during macro expansion: | |
| [error] scala.ScalaReflectionException: value apply encapsulates multiple overloaded alternatives and cannot be treated as a method. Consider invoking `<offending symbol>.asTerm.alternatives` and manually picking the required method | |
| [error] at scala.reflect.api.Symbols$SymbolApi$class.asMethod(Symbols.scala:279) | |
| [error] at scala.reflect.internal.Symbols$SymbolContextApiImpl.asMethod(Symbols.scala:73) | |
| [error] at play.api.libs.json.JsMacroImpl$.readsImpl(JsMacroImpl.scala:44) | |
| [error] one error found |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for the answer! By the way, the JSON API rulez!