Thread overview
[Issue 22156] Can't use all-types slice of not-all-types AliasSeq as type
Feb 28, 2023
RazvanN
Feb 28, 2023
Nick Treleaven
Mar 03, 2023
Ate Eskola
February 28, 2023
https://issues.dlang.org/show_bug.cgi?id=22156

RazvanN <razvan.nitu1305@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |razvan.nitu1305@gmail.com
         Resolution|---                         |INVALID

--- Comment #1 from RazvanN <razvan.nitu1305@gmail.com> ---
Why should this code compile? To be able to slice the type, the compiler requires a valid type? Since AliasSeq!(int, 0) is not a valid type, you cannot slice it. I don't think that this bug report is valid.

Tentatively closing as invalid. But please feel free to reopen upon further clarifications.

As a workaround, you can first extract the types from the AliasSeq and than create the needed tuple type.

--
February 28, 2023
https://issues.dlang.org/show_bug.cgi?id=22156

Nick Treleaven <nick@geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nick@geany.org

--- Comment #2 from Nick Treleaven <nick@geany.org> ---
Indexing such a sequence compiles fine, so slicing not working is inconsistent:

AliasSeq!(int, 0)[0] a; // OK
AliasSeq!(int, char, 0)[0..2] b; // NG
AliasSeq!(int, char)[0..2] c; // OK

--
March 03, 2023
https://issues.dlang.org/show_bug.cgi?id=22156

Ate Eskola <Ajieskola@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |---

--- Comment #3 from Ate Eskola <Ajieskola@gmail.com> ---
Reopened for reasons explained by Nick.

--