Open alexarchambault opened 4 years ago
An attempt of doing this can be seen here: https://github.com/hamnis/dataclass-scalafix
What about the new Scala 3 macro annotations? Do we know if they are powerful enough for this library?
@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?).
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.