densh / scala-offheap

Experimental type-safe off-heap memory for Scala.
BSD 3-Clause "New" or "Revised" License
532 stars 38 forks source link

Allow overriding of automatically generated members of @data classes #87

Open florv opened 8 years ago

florv commented 8 years ago

It would be nice if it was possible to override automatically generated members of @data classes. It will then be possible to compile something like this bare example:

@data class A(a: Int, b: Int) {
  def toString(): String = {
    "foo"
  }

  def copy()(implicit a: Allocator): A = {
    A(a, b)
  }
}
densh commented 8 years ago

This makes sense, it shouldn't be hard to make macro annotations let user define their own implementations of some of the pre-generated methods.