← Back to index
|
Original Bugzilla link
Bug 1221 – Incorrect template return value
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
Other
OS
Linux
Creation time
2007-05-08T12:33:00Z
Last change time
2014-02-16T15:22:21Z
Assigned to
bugzilla
Creator
onlystupidspamhere
Comments
Comment #0
by onlystupidspamhere — 2007-05-08T12:33:41Z
Something weird happens here: template foo() { const char[] foo = ""==null ? "" : ""; } // Error: pragma msg string expected for message, not '"" == null ? "" : ""' pragma(msg, foo!()); // Error: pragma msg string expected for message, not 'char[]' pragma(msg, typeof(foo!())); // But this works correctly pragma(msg, typeof(foo!()).stringof); // prints 'char[]' // Error: pragma msg string expected for message, not 'bar' template bar() { const bar = ""==null ? "" : ""; } // Error: pragma msg string expected for message, not 'char[0]' pragma(msg, foo!());
Comment #1
by onlystupidspamhere — 2007-09-27T18:52:11Z
The second pragma was invalid and the last one had a typo, but otherwise seems to work now at least with dmd 1.021.