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.