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
Right now, records that use field inclusion have the standard two construction methods in their companion (building from DataMap and with all fields specified explicitly). I think it'd be useful to add additional methods, perhaps called assemble, that accept the included arguments as records instead of individual fields. For example:
record A {
field1: int
// many others
}
record B {
...A
fieldB: string
}
I'd like to construct B with B.assemble(A(...), "fieldB"), instead of B(1, ..., "fieldB").
For records with multiple inclusions, I think generating a single assemble that accepts all included records plus all additional fields is sufficiently useful (rather than worrying about the complexity of overloads for different inclusion combinations).
The text was updated successfully, but these errors were encountered:
Also, some opposite disassemble (or deconstruct or unapply) methods would be useful and they would have prevented the example bug that I describe in #60 .
Right now, records that use field inclusion have the standard two construction methods in their companion (building from
DataMap
and with all fields specified explicitly). I think it'd be useful to add additional methods, perhaps calledassemble
, that accept the included arguments as records instead of individual fields. For example:I'd like to construct
B
withB.assemble(A(...), "fieldB")
, instead ofB(1, ..., "fieldB")
.For records with multiple inclusions, I think generating a single
assemble
that accepts all included records plus all additional fields is sufficiently useful (rather than worrying about the complexity of overloads for different inclusion combinations).The text was updated successfully, but these errors were encountered: