[Issue 12632] New: Out of range indexing for std.typecons.Tuple emits a bad diagnostic
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Thu Apr 24 05:27:29 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=12632
Issue ID: 12632
Summary: Out of range indexing for std.typecons.Tuple emits a
bad diagnostic
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: diagnostic
Severity: normal
Priority: P1
Component: Phobos
Assignee: nobody at puremagic.com
Reporter: andrej.mitrovich at gmail.com
-----
import std.typecons;
import std.typetuple;
void main()
{
{
auto tup = TypeTuple!(1);
auto a = tup[0]; // ok
auto b = tup[1]; // Error: array index [1] is outside array bounds [0 ..
1]
}
{
auto tup = tuple(1);
auto a = tup[0]; // ok
auto b = tup[1]; // Error: no [] operator overload for type Tuple!int
}
}
-----
The second diagnostic is not informative.
--
More information about the Digitalmars-d-bugs
mailing list