Skip to content

Instantly share code, notes, and snippets.

@stephanos
Last active December 12, 2015 04:49
Show Gist options
  • Select an option

  • Save stephanos/4717443 to your computer and use it in GitHub Desktop.

Select an option

Save stephanos/4717443 to your computer and use it in GitHub Desktop.
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, "")
}
[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
@stephanos

Copy link
Copy Markdown
Author

Thank you for the answer! By the way, the JSON API rulez!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment