Maintaining Type Integrity When Modifying Common Fields in Tagged Unions
Hello, I try to modify a common field on a "union of tagged class", without loosing the original type. I did a repro here: https://effect.website/play#906e44210193. all elements have a common field, so I don't have to match my union to access the common field. I don't modify the common field, but I use the spread operator to have a copy of my object, but once I did that, the new object become a tagged struct, and in some case, it's not compatible with tagged class.
