Bug 6267 – Regression(2.054 beta): Can't increment alias this'd struct from ref return

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2011-07-07T15:47:00Z
Last change time
2011-07-10T07:40:10Z
Keywords
patch, rejects-valid
Assigned to
nobody
Creator
dsimcha

Comments

Comment #0 by dsimcha — 2011-07-07T15:47:41Z
2.054 beta regression. struct Double1 { double val = 1; alias val this; } struct DNAHash(T) { T[] data; this(ubyte width) {} ref T opIndex(S)(S seq) { return data[0]; } } void main() { auto hash = DNAHash!(Double1)(2); hash["f"]++; } test9.d(18): Error: var has no effect in expression (__pitmp5)
Comment #1 by kennytm — 2011-07-08T00:21:40Z
The bug was introduced in commit b3df2 when fixing issue 5551. https://github.com/D-Programming-Language/dmd/commit/b3df2
Comment #2 by yebblies — 2011-07-09T22:48:37Z
Comment #3 by yebblies — 2011-07-10T07:40:10Z