[Issue 196] New: Static assertion involving typedef's base type fails strangely
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Jun 15 02:42:37 PDT 2006
http://d.puremagic.com/issues/show_bug.cgi?id=196
Summary: Static assertion involving typedef's base type fails
strangely
Product: D
Version: 0.160
Platform: PC
OS/Version: Windows
Status: NEW
Keywords: diagnostic, rejects-valid
Severity: major
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: deewiant at gmail.com
I need to static assert that a typedef's base type is equal to int.
I tried the code below, but it fails with the message "static assert (is(int
== int)) is false". If this is not meant to work, this is a bug in the sense
that the error message makes no sense; if this is meant to work, it's a bug in
the sense that it doesn't work.
In the former case, feel free to change the priority, severity, and keywords to
match: I'm currently assuming that this should work.
--
typedef int x;
static assert (is (typeof(typeid(x).base) == int));
--
Also, there's an extra space between "assert" and "(is" in the error message.
--
More information about the Digitalmars-d-bugs
mailing list