[Issue 20624] New: [REG2.088] AA access gives wrong deprecation message.
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Mar 1 19:39:21 UTC 2020
https://issues.dlang.org/show_bug.cgi?id=20624
Issue ID: 20624
Summary: [REG2.088] AA access gives wrong deprecation message.
Product: D
Version: D2
Hardware: x86
OS: Mac OS X
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: johanengelen at weka.io
The following code gives a wrong deprecation message since DMD 2.088:
```
import std.typecons;
alias T = Nullable!ulong;
T normal;
T[4] array;
T[string] aa;
void g(string s, ulong value) {
normal = value; // no problem
array[0] = value; // no problem
aa[s] = value;
// Should directly use opAssign. Instead gives wrong deprecation message:
// std.typecons.Nullable!ulong.Nullable.get_ is deprecated - Implicit
conversion with alias Nullable.get this will be removed after 2.096. Please use
.get explicitly.
aa[s].opAssign(value); // workaround that works without deprecation msg
}
void main() {
g("hoi", 1);
}
```
The deprecation message is invalid: alias this is never used (because
Nullable.opAssign is directly callable). Moreover, the suggested fix (".get()")
results in wrong code.
--
More information about the Digitalmars-d-bugs
mailing list