www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12093] New: bad error message: Error: no [] operator overload for type Tuple!(string, string)

reply d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12093

           Summary: bad error message: Error: no [] operator overload for
                    type Tuple!(string, string)
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: timothee.cour2 gmail.com



18:43:32 PST ---
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

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 06 2014
parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12093


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich gmail.com



01:15:08 PST ---
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
}
-----

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 07 2014