Bug 582 – Cannot slice mixed tuples

Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2006-11-21T16:17:00Z
Last change time
2014-02-15T13:20:52Z
Keywords
rejects-valid, spec
Assigned to
bugzilla
Creator
daekharel

Comments

Comment #0 by daekharel — 2006-11-21T16:17:58Z
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.
Comment #1 by kirklin.mcdonald — 2006-11-23T05:40:13Z
See also bug 586, which refers to the same problem with indexing tuples.
Comment #2 by thomas-dloop — 2006-11-25T12:05:40Z
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [email protected] 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 -----BEGIN PGP SIGNATURE----- iD8DBQFFaJFeLK5blCcjpWoRAnR2AJ9ZrCFa67CB35bDbwS3EmTdVyyJEgCeMejK LYjg6Snw64zoCKVPk8JH6+Q= =VeGL -----END PGP SIGNATURE-----
Comment #3 by bugzilla — 2007-04-20T13:16:31Z
Fixed DMD 1.013