Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the macro to support overloaded apply #19

Open
gpoirier opened this issue Jul 24, 2015 · 0 comments
Open

Update the macro to support overloaded apply #19

gpoirier opened this issue Jul 24, 2015 · 0 comments

Comments

@gpoirier
Copy link
Contributor

The way the DSL code is generated by createSchema regarding the apply partially applied function, it prevent the possibility to have overloaded apply methods on the companion object of a case class where the macro is being used. There's a FIXME in the code related to this:
https://github.com/ypg-data/sparrow/blob/master/core/src/test/scala/com.mediative.sparrow/SchemaSpec.scala#L67

The solution is to replace the following style in the generated code:

implicit val schema = (
  field[String]("name") and
  field[Long]("count")
)(apply _)

By something of this style:

implicit val schema = (
  field[String]("name") and
  field[Long]("count")
)((name: String, count: Long) => apply(name, count))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant