Since @disable this() still leaves an invalid .init open, TaggedAlgebraic.init has now been changed to always contain the .init value of the first specified sub type.
Note that this change is restricted to DMD 2.072 and up, because earlier versions of DMD do not allow postblits or destructors within unions and using a union appears to be the only way to implement this.
- Uses std.conv.to to implement opCast instead of just supporting implicit type conversions
- Adds .toString to make to!string(ta) return the expected result
Although there will be situations where the enum names equal the name of the types stored in a TaggedAlgebraic, "type" is often not the right term. It's also possible to define multiple fields of the same type, but with different names. "Kind" is used now as a more generic alternative.
- Added @disableIndex to disable opIndex forwarding for certain fields
- Added field/properly forwarding
- Fixed binary operator overloading
- Allow implicit conversions when trying to match return types to TaggedAlgebraic during operator return type deduction