← Back to index
|
Original Bugzilla link
Bug 2777 – alias this doesn't forward __dollar and slice op.
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2009-04-01T08:51:00Z
Last change time
2015-06-09T01:18:03Z
Assigned to
nobody
Creator
dsimcha
Comments
Comment #0
by dsimcha — 2009-04-01T08:51:46Z
import std.stdio; struct ArrayWrapper(T) { T[] array; alias array this; } void main() { ArrayWrapper!(uint) foo; foo.length = 5; // Works foo[0] = 1; // Works writeln(foo[0]); // Works writeln(foo[$ - 1]); // Error: undefined identifier __dollar writeln(foo[0..2]); // Error: ArrayWrapper!(uint) cannot be sliced with [] }
Comment #1
by bugzilla — 2011-08-24T21:53:07Z
https://github.com/D-Programming-Language/dmd/commit/7c29678ed254fc5e577b7a341a12de5b58efd4f5