digitalmars.D.bugs - [Issue 1221] New: Incorrect template return value
- d-bugmail puremagic.com (25/25) May 08 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1221
- d-bugmail puremagic.com (10/10) Sep 27 2007 http://d.puremagic.com/issues/show_bug.cgi?id=1221
http://d.puremagic.com/issues/show_bug.cgi?id=1221 Summary: Incorrect template return value Product: D Version: 1.014 Platform: Other OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: onlystupidspamhere yahoo.se 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!()); --
May 08 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1221 onlystupidspamhere yahoo.se changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED ------- Comment #1 from onlystupidspamhere yahoo.se 2007-09-27 18:52 ------- The second pragma was invalid and the last one had a typo, but otherwise seems to work now at least with dmd 1.021. --
Sep 27 2007