densh / scala-offheap

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

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

Open florv opened 9 years ago

florv commented 9 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 9 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.