www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20552] New: Deprecated Nullable.get warning with Appenders

https://issues.dlang.org/show_bug.cgi?id=20552

          Issue ID: 20552
           Summary: Deprecated Nullable.get warning with Appenders
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: tjonsies818 yahoo.com

Migrated over from the dlang forums [1].

You get a deprecation warning when using Nullable members in a struct and an
appender.

The repro case is pretty simple:
```
import std.array : appender, Appender;
import std.typecons : Nullable;

struct StructWithNullable {
    Nullable!(string) nullableString;
}

void main()
{
    Appender!(StructWithNullable[]) structWithNullableAppender;
    structWithNullableAppender.put(StructWithNullable.init);
}
```

On the playground this prints the following warnings:

```
/dlang/dmd/linux/bin64/../../src/phobos/std/traits.d(3688): Deprecation:
function std.typecons.Nullable!string.Nullable.get_ is deprecated - Implicit
conversion with alias Nullable.get this will be removed after 2.096. Please use
.get explicitly.
/dlang/dmd/linux/bin64/../../src/phobos/std/traits.d(3689): Deprecation:
function std.typecons.Nullable!string.Nullable.get_ is deprecated - Implicit
conversion with alias Nullable.get this will be removed after 2.096. Please use
.get explicitly.
```

One challenge is the error doesn't point you to the source of where the problem
is occurring, and it can be very difficult to isolate the root cause of the
issue.

[1] https://forum.dlang.org/post/tuczsbvyocxzrejgdrdf forum.dlang.org.

--
Jan 31 2020