I accidentally found that I was implicitly casting in my code a const vibed Json type to a mutable Json type.
I thought "that can't be right, how does that even work? Especially if the Json is an object or an array!".
But it does. At least since 2014.
See https://issues.dlang.org/show_bug.cgi?id=12885
Enjoy a nice cast-free way to use sumtype to unconstify references in @safe code!
import std.sumtype;
void main() @safe
{
alias MyType = SumType!(int, char[]);
auto mt = const(MyType)("hello");
MyType m2 = mt;
char[] result = m2.tryMatch!((char[] a) => a);
result[0] = 'j'; // segfault
}
-Steve