Bug 10692 – Deprecation isn't checked using alias this
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-07-21T19:16:04Z
Last change time
2018-11-05T15:46:38Z
Assigned to
No Owner
Creator
Jesse Phillips
Comments
Comment #0 by Jesse.K.Phillips+D — 2013-07-21T19:16:04Z
I would expect accessing members of B to fail when accessed with alias this:
struct B {
int i;
}
struct A {
B b;
deprecated alias b this;
}
void main() {
A a;
a.i = 5; // Deprecated
assert(a.i == 5); // Deprecated
}
Comment #1 by razvan.nitu1305 — 2018-10-11T18:03:43Z
Note that a plain 'alias' declaration specifically does not add modifiers, storage classes, attributes, etc. It's not a wrapper. It just forwards the lookup to the symbol. It should ignore any attributes, like plain alias does.
Added a clarification to the spec:
https://github.com/dlang/dlang.org/pull/2487
Comment #3 by github-bugzilla — 2018-11-05T15:46:37Z