Bug 21069 – Variant.get!Variant segfault

Status
NEW
Severity
major
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2020-07-24T01:18:03Z
Last change time
2024-12-01T16:37:22Z
Assigned to
No Owner
Creator
Steven Schveighoffer
Moved to GitHub: phobos#10431 →

Comments

Comment #0 by schveiguy — 2020-07-24T01:18:03Z
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
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10431 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB