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.
If you use the "-de" switch, however, the code compiles and no deprecation warnings are shown.
This PR: https://github.com/dlang/dmd/pull/10677 appears to be related.
Compiling this with git HEAD yields: /home/razvan/dmd/phobos/std/traits.d(3727): 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. /home/razvan/dmd/druntime/import/core/internal/traits.d(233): instantiated from here: `F!(Nullable!string)` /home/razvan/dmd/phobos/std/meta.d(880): instantiated from here: `anySat!(hasElaborateAssign, Nullable!string)` /home/razvan/dmd/phobos/std/traits.d(3729): instantiated from here: `anySatisfy!(hasElaborateAssign, Nullable!string)` /home/razvan/dmd/druntime/import/core/internal/traits.d(233): ... (5 instantiations, -v to show) ... /home/razvan/dmd/phobos/std/array.d(3468): instantiated from here: `emplaceRef!(StructWithNullable, StructWithNullable, StructWithNullable)` test.d(12): instantiated from here: `put!(StructWithNullable)` Note that the instantion point (test.d(12)) is present in the output, so this is a phobos issue, not a dmd one. Changing component to reflect that.
@RazvanN7 created dlang/phobos pull request #7759 "Fix Issue 20552 - Deprecated Nullable.get warning with Appenders" fixing this issue: - Fix Issue 20552 - Deprecated Nullable.get warning with Appenders https://github.com/dlang/phobos/pull/7759
dlang/phobos pull request #7759 "Fix Issue 20552 - Deprecated Nullable.get warning with Appenders" was merged into stable: - 51bdf472dfb659cddb725cea153f0be103313e32 by RazvanN7: Fix Issue 20552 - Deprecated Nullable.get warning with Appenders https://github.com/dlang/phobos/pull/7759