Thread overview
[Issue 582] New: Cannot slice mixed tuples
Nov 21, 2006
d-bugmail
Nov 23, 2006
d-bugmail
Nov 25, 2006
Thomas Kuehne
Apr 20, 2007
d-bugmail
November 21, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=582

           Summary: Cannot slice mixed tuples
           Product: D
           Version: 0.174
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: rejects-valid, spec
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: daekharel@gmail.com


template Tuple(E ...) { alias E Tuple; }

alias Tuple!(float, float, 3) TP;
alias TP[0..length-1] TQ;

DMD gives following error when compiling the above:

err.d(4): tuple E is used as a type
err.d(4): Error: can only slice tuple types, not void

This doesn't exactly contradict the spec (AFAIK), which is a little vague about using tuples outside of templates, but it does directly contradict the essay at http://www.digitalmars.com/d/tuple.html, which in fact uses this as an example.


-- 

November 23, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=582





------- Comment #1 from kirklin.mcdonald@gmail.com  2006-11-23 05:40 -------
See also bug 586, which refers to the same problem with indexing tuples.


-- 

November 25, 2006
d-bugmail@puremagic.com schrieb am 2006-11-21:
> http://d.puremagic.com/issues/show_bug.cgi?id=582

> template Tuple(E ...) { alias E Tuple; }
>
> alias Tuple!(float, float, 3) TP;
> alias TP[0..length-1] TQ;
>
> DMD gives following error when compiling the above:
>
> err.d(4): tuple E is used as a type
> err.d(4): Error: can only slice tuple types, not void
>
> This doesn't exactly contradict the spec (AFAIK), which is a little vague about using tuples outside of templates, but it does directly contradict the essay at http://www.digitalmars.com/d/tuple.html, which in fact uses this as an example.

Added to DStress as http://dstress.kuehne.cn/compile/t/tuple_05_A.d http://dstress.kuehne.cn/compile/t/tuple_05_B.d http://dstress.kuehne.cn/compile/t/tuple_05_C.d http://dstress.kuehne.cn/compile/t/tuple_05_D.d

Thomas


April 20, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=582


bugzilla@digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #3 from bugzilla@digitalmars.com  2007-04-20 13:16 -------
Fixed DMD 1.013


--