May 08, 2007 [Issue 1221] New: Incorrect template return value | ||||
---|---|---|---|---|
| ||||
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!()); -- |
September 27, 2007 [Issue 1221] Incorrect template return value | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | 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. -- |
Copyright © 1999-2021 by the D Language Foundation