You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I agree this would be convenient, but it's kind of tricky to achieve in practice. Trickier than toString, equals, hashCode, etc., which already do that.
Because users may decide to add extra convenient with* methods, refering the generated ones, like
My understanding is that the macros of data-class run before the type checker, so in that case we have no way of knowing for sure if a withFile method replaces the generated one or is just an extra override.
But maybe adding a @nosetter annotation, to disable generating with* methods for particular fields, would work, like
@data classFoo(@nosetter bar: String, baz: Int) {
defwithBar(bar: String):Foo=???
}
does not work, maybe this should?
I would expect
withBaz
to be generated, but not withBarThe text was updated successfully, but these errors were encountered: