[Issue 20175] New: Nullable!T.get(x) immutable array elements downgraded to const
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Aug 27 22:16:12 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=20175
Issue ID: 20175
Summary: Nullable!T.get(x) immutable array elements downgraded
to const
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: elpenguino+D at gmail.com
```
import std.typecons : Nullable;
Nullable!string x;
static assert(is(typeof(x.get()) == string)); //OK!
static assert(is(typeof(x.get("")) == string)); //UH OH
```
We get const(char)[] instead of the expected string.
--
More information about the Digitalmars-d-bugs
mailing list