digitalmars.D.bugs - [Issue 1901] New: Structs with alias template params not accepted as types in declarations
- d-bugmail puremagic.com (34/34) Mar 09 2008 http://d.puremagic.com/issues/show_bug.cgi?id=1901
- d-bugmail puremagic.com (8/8) Mar 09 2008 http://d.puremagic.com/issues/show_bug.cgi?id=1901
http://d.puremagic.com/issues/show_bug.cgi?id=1901 Summary: Structs with alias template params not accepted as types in declarations Product: D Version: 1.028 Platform: PC OS/Version: Linux Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: DMD AssignedTo: bugzilla digitalmars.com ReportedBy: dhasenan gmail.com A parse error, apparently: struct Test(alias test) { void run() { test(); } } struct Something(char[] s) { char[] name () { return s; } } alias Test!({ Stdout("test!").newline; }) test; // fine void main() { Something!(`hello`) thing; // fine test t; // fine Test!({ Stdout("test!").newline; }) z; // fail, error: //plan.d(30): found 'z' when expecting ';' following 'statement' } I was hoping to use this means as a brief way of declaring unit tests in an xUnit-like system (and iterate through them using .tupleof) --
Mar 09 2008
http://d.puremagic.com/issues/show_bug.cgi?id=1901 dhasenan gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Version|1.028 |1.025 Noticed this in 1.025 as well; not sure how old it is. --
Mar 09 2008