Bug 12093 – bad error message: Error: no [] operator overload for type Tuple!(string, string)

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-02-06T18:43:32Z
Last change time
2020-07-04T17:59:15Z
Keywords
diagnostic
Assigned to
No Owner
Creator
Timothee Cour

Comments

Comment #0 by timothee.cour2 — 2014-02-06T18:43:32Z
void main(){ import std.algorithm; auto a="".findSplitBefore(" "); auto b0=a[0]; // OK auto b1=a[2]; // Error: no [] operator overload for type Tuple!(string, string) } should be: out of bound error
Comment #1 by andrej.mitrovich — 2014-02-07T01:15:08Z
Reduced: ----- struct S(T...) { T x; alias x this; } void main() { S!(int) s; auto x = s[0]; auto x = s[1]; // Error: no [] operator overload for type S!int } -----
Comment #2 by andrej.mitrovich — 2014-04-27T11:30:53Z
*** Issue 12632 has been marked as a duplicate of this issue. ***
Comment #3 by b2.temp — 2020-07-04T17:59:15Z
diagnostic is right since v2.068