By accident, I tried to get a Variant out of a Variant.
The result is a segfault.
Variant v = 1;
auto y = v.get!Variant; // segfault
I don't think this should segfault. I don't know what the code is doing. There are two options to fix this:
1. get!Variant should be statically disallowed.
2. Preferred: get!Variant should `return this;`.
The second option allows generic code to not have to care about whether the type requested is gettable. i.e. I don't have to write:
static if(is(T == Variant)) return v;
else return v.get!T;
Comment #1 by robert.schadek — 2024-12-01T16:37:22Z