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
Comment #2 by bugzilla — 2018-10-15T02:18:39Z
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
Commits pushed to master at https://github.com/dlang/dlang.org https://github.com/dlang/dlang.org/commit/41e16e99cad0c2e5e1c80445b808a812974ba32e fix Issue 10692 - Deprecation isn't checked using alias this https://github.com/dlang/dlang.org/commit/35099f656fbcd0413065273cfde9e57df6f56bdd Merge pull request #2487 from WalterBright/fix10962 fix Issue 10692 - Deprecation isn't checked using alias this merged-on-behalf-of: Andrei Alexandrescu <[email protected]>