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

Would be nice to make it work with Abstract Type Members #9

Open
cgarciaq opened this issue Mar 20, 2020 · 1 comment
Open

Would be nice to make it work with Abstract Type Members #9

cgarciaq opened this issue Mar 20, 2020 · 1 comment

Comments

@cgarciaq
Copy link

It does not work with abstract type members. The following code is not working, but would be very nice if it did:

trait Resource {
  type T <: Product
  
  def resourceForm = Form(CaseClassMapping.mapping[T])
  ...
}

trait ApplesComponent extends Resource {
  type T = Apple

  case class Apple(size:Int, color: String)
  ...
}

I think it can be achieved using WeakTypeTag, but I'm not sure.

@dontgitit
Copy link
Contributor

Yeah it doesn't even work for type aliases: #2

You can try https://github.com/Iterable/play-formnolia which uses Magnolia under the hood, it might work with abstract types (though I haven't personally tried it for that use case)

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

2 participants