alexarchambault / data-class

case-classes with better binary compatibility story
Apache License 2.0
79 stars 6 forks source link

Rewrite with scalafix? #27

Open alexarchambault opened 4 years ago

alexarchambault commented 4 years ago

Like simulacrum, data-class relies on macro annotations, that are going away in dotty / scala 3. simulacrum was rewritten as a set of scalafix rules for dotty. We should probably consider doing something along those lines here at some point.

hamnis commented 2 years ago

An attempt of doing this can be seen here: https://github.com/hamnis/dataclass-scalafix

adpi2 commented 1 year ago

What about the new Scala 3 macro annotations? Do we know if they are powerful enough for this library?

alexarchambault commented 1 year ago

@adpi2 I think they should, with some adaptations (from what I recall, it doesn't allow to add things to the companion object of an annotated class, but new being optional means tweaking constructors is enough, and the unapply isn't needed anymore in Scala 3 IIRC). But using them needs to be allowed from stable Scala 3 versions (maybe 3.3.0 will allow that?).