https://issues.dlang.org/show_bug.cgi?id=21011
Issue ID: 21011
Summary: Variant and tuples by index
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: minor
Priority: P1
Component: phobos
Assignee: [email protected]
Reporter: [email protected]
Test case:
----------------
Variant test = tuple(1,2);
writeln(test[0]);
----------------
errors:
----------------
std.variant.VariantException@std\variant.d(1715): Variant: attempting to use
incompatible types std.typecons.Tuple!(int, int).Tuple
and int
----------------
0x000000013F1292DB in
std.variant.VariantN`20LU.VariantN.handler!(std.typecons.Tuple!(int,
int)).handler at C:\D\dmd2\windows\bin\..\..\src\phobos\std\variant.d(475)
0x000000013F134536 in std.variant.VariantN`20LU.VariantN.opIndex!int.opIndex at
C:\D\dmd2\windows\bin\..\..\src\phobos\std\variant.d(1113)
----------------
https://github.com/dlang/phobos/blob/master/std/variant.d#L475
access by index not working on tuples?
but: writeln(test) - working;
--