Bug 8080 – 'alias this' causes toString to be shadowed by aliased object

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-05-10T13:00:00Z
Last change time
2012-07-25T13:37:33Z
Keywords
pull, wrong-code
Assigned to
nobody
Creator
hsteoh

Comments

Comment #0 by hsteoh — 2012-05-10T13:00:39Z
Code: struct S { short[4] data; alias this data; string toString() { ... } } ... S s; writeln(to!string(s)); In dmd 2.059 (I believe) and earlier, this calls S.toString(). However, in git dmd, this calls data.toString() instead.
Comment #1 by k.hara.pg — 2012-05-12T09:23:07Z
Comment #2 by github-bugzilla — 2012-05-22T12:40:09Z
Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/40de9e601b3d80189d9e8b1f5b32d8b00270f610 fix Issue 8080 - 'alias this' causes toString to be shadowed by aliased object