Bug 4570 – ElementType!(void[]) shows error message.

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-08-02T03:00:00Z
Last change time
2010-08-05T07:19:06Z
Assigned to
nobody
Creator
zan77137

Comments

Comment #0 by zan77137 — 2010-08-02T03:00:40Z
This code displays an error: -------------- main.d ---------------------- import std.range; pragma(msg, ElementType!(void[])); ------------------------------------ dmd -c main void std\array.d(357): Error: [i] has no effect in expression (a[0u]) I think that this error message should be removed. If there is not an objection, I rewrite ElementType template as this: ------------------------------------ template ElementType(R) { static if (is(typeof({return R.init.front();}()) T)) alias T ElementType; else alias void ElementType; } ------------------------------------
Comment #1 by zan77137 — 2010-08-05T07:19:06Z