so one of the things I want is validation on sette...
# language-proposals
g
so one of the things I want is validation on setters for data classes. This is currently kind've a pain in the butt. with a data class, you cant override setters, and you cant use properties. AFAIK this is for syntax reasons more than anything, the semantics of
equals
and
copy
should be undisturbed by the fields being backed by properties or explicit getter/setters. How about:
Copy code
data class MyPOJO(val regular: Boolean, var mutableAlsoRegular: Char){
  constructor val thirdWithExplicitGet: Int get() = TODO();
  constructor val fourthByProperty by someProperty { TODO() }
  constructor var fifth with explicits: String
      get() = TODO()
      set(value) = TODO("$value")
}
which would be destructured as a 5-arity, with `equals`/`hashcode` including
third
fourth
and
fifth
, its `copy()`would include defaulted parameters for the fifth field, and its constructor signature would be
first: X, second: X, fifth: X