Bug 556 – is (Type Identifier : TypeSpecialization) doesn't work as it should

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P4
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-11-18T07:06:00Z
Last change time
2014-02-15T13:21:21Z
Keywords
rejects-valid, spec
Assigned to
bugzilla
Creator
matti.niemenmaa+dbugzilla
Blocks
511

Comments

Comment #0 by matti.niemenmaa+dbugzilla — 2006-11-18T07:06:32Z
A code snippet somewhat modified from what's in the spec: alias short bar; void foo(bar x) { static if (is (bar T : int)) alias T S; else alias real S; static assert (is (S == int)); } void main() { bar x; foo(x); } This fails, though according to the spec it should work. What's strange is that replacing the first two lines of foo() with the following works: static if (is (bar : int)) alias int S; Disclaimer: I haven't used this (is (Type Identifier)) feature at all, so I'm not 100% sure. But if this isn't meant to work then the example code in the spec is wrong.
Comment #1 by bugzilla — 2007-10-04T03:58:02Z
The documentation is in error, I'll fix it.
Comment #2 by braddr — 2007-10-20T04:03:28Z
Docs updated in 1.022/2.005