digitalmars.D.learn - Deprecation message when assigning Nullable values to an associative
- Peter Jacobs (43/43) Apr 03 2021 I am using the OpenMPI binding and, in recent times, I have been
- rikki cattermole (5/5) Apr 03 2021 Nullable has an alias this which has been deprecated.
- rikki cattermole (3/11) Apr 03 2021 So yeah, next release.
- Peter Jacobs (3/14) Apr 03 2021 Thank you. I am happy with this situation.
I am using the OpenMPI binding and, in recent times, I have been getting a deprecation message when compiling. It seems to be related to assigning Nullable!int entries to an associative array. The following program shows the same message three times but it does run as I expect. import std.stdio, std.typecons; void main(string[] args) { Nullable!(int)[string] my_entries; // First way. my_entries["A"] = Nullable!int.init; // Second way. Nullable!(int) empty; my_entries["B"] = empty; // Third way. my_entries["C"] = 0.nullable; my_entries["C"].nullify(); writeln("my_entries=", my_entries); Nullable!(int) b = Nullable!int.init; writeln("b=", b); Nullable!(int) c = 0.nullable; writeln("c=", c); } peterj helmholtz ~/work/play/dlang $ dmd null_test.d null_test.d(7): Deprecation: function `std.typecons.Nullable!int.Nullable.get_` is deprecated - Implicit conversion with `alias Nullable.get this` will be removed after 2.096. Please use `.get` explicitly. null_test.d(10): Deprecation: function `std.typecons.Nullable!int.Nullable.get_` is deprecated - Implicit conversion with `alias Nullable.get this` will be removed after 2.096. Please use `.get` explicitly. null_test.d(12): Deprecation: function `std.typecons.Nullable!int.Nullable.get_` is deprecated - Implicit conversion with `alias Nullable.get this` will be removed after 2.096. Please use `.get` explicitly. peterj helmholtz ~/work/play/dlang $ ./null_test my_entries=["A":Nullable.null, "C":Nullable.null, "B":Nullable.null] b=Nullable.null c=0 Can someone please tell me how I should set these associative array entries such that I keep the compiler happy?
Apr 03 2021
Nullable has an alias this which has been deprecated. It is due for removal (the alias this). You can remove it manually from your copy of phobos source. Otherwise you'll just have to wait until it is removed upstream. (deprecation are not errors, so you can ignore them).
Apr 03 2021
On 03/04/2021 10:58 PM, rikki cattermole wrote:Nullable has an alias this which has been deprecated. It is due for removal (the alias this). You can remove it manually from your copy of phobos source. Otherwise you'll just have to wait until it is removed upstream. (deprecation are not errors, so you can ignore them).So yeah, next release. https://github.com/dlang/phobos/commit/36c309fc5fb5bc886e14bd8010e1375fa3a57d53#diff-81bed7f05cbd4e992067b7019125e6a1349ebe5098c6980b64bbbca8d5491e17
Apr 03 2021
On Saturday, 3 April 2021 at 10:03:09 UTC, rikki cattermole wrote:On 03/04/2021 10:58 PM, rikki cattermole wrote:Thank you. I am happy with this situation. PJNullable has an alias this which has been deprecated. It is due for removal (the alias this). You can remove it manually from your copy of phobos source. Otherwise you'll just have to wait until it is removed upstream. (deprecation are not errors, so you can ignore them).So yeah, next release. https://github.com/dlang/phobos/commit/36c309fc5fb5bc886e14bd8010e1375fa3a57d53#diff-81bed7f05cbd4e992067b7019125e6a1349ebe5098c6980b64bbbca8d5491e17
Apr 03 2021