old Declaration code used algebraic, which is more efficiently replaced with sumtype.
I replaced the mixin-generated properties with manual properties, since the code is very small for them anyway and helps them being shown in DCD
Since SumType works with well-defiend types, opEquals and visitIfNotNull was trivial to implement.
Saves around 0-3 MB of actual peak RAM in a ~170 MB test environment (could just be fluctuations how much it actually is, but it will definitely include some RAM savings, since we no longer store a bunch of nulls for common types)
Easy backwards-compatible improvement I think.
Made setters backwards-incompatible on purpose, since we don't want accidental assignment of 2 different types on the same sumtype.
old Declaration code used algebraic, which is more efficiently replaced with sumtype.
I replaced the mixin-generated properties with manual properties, since the code is very small for them anyway and helps them being shown in DCD
Since SumType works with well-defiend types, opEquals and visitIfNotNull was trivial to implement.
Saves around 0-3 MB of actual peak RAM in a ~170 MB test environment (could just be fluctuations how much it actually is, but it will definitely include some RAM savings, since we no longer store a bunch of nulls for common types)
Easy backwards-compatible improvement I think.
Made setters backwards-incompatible on purpose, since we don't want accidental assignment of 2 different types on the same sumtype.