digitalmars.D.bugs - [Issue 12674] New: alias parameter does not accept specAlias and
- via Digitalmars-d-bugs (55/55) Apr 28 2014 https://issues.dlang.org/show_bug.cgi?id=12674
https://issues.dlang.org/show_bug.cgi?id=12674 Issue ID: 12674 Summary: alias parameter does not accept specAlias and defaultAlias when both are types Product: D Version: D2 Hardware: All OS: All Status: NEW Keywords: rejects-valid Severity: normal Priority: P1 Component: DMD Assignee: nobody puremagic.com Reporter: andrej.mitrovich gmail.com ----- template TemplVals( alias AliasParamSpecVal : 1, alias AliasParamDefaultVal = 1, alias AliasParamSpecDefaultVal : 1 = 2, ) { } template TemplTypes( alias AliasParamSpecType : int, alias AliasParamDefaultType = int, alias AliasParamSpecDefaultType : long = int, // syntax error ) { } void main() { alias a = TemplVals!(1, 1, 1); // ok alias b = TemplVals!(1); // ok alias c = TemplTypes!(int, int, int); // should be ok alias d = TemplTypes!(int); // should be ok } ----- Note that Type parameters work for the above test: ----- template TemplVals( alias AliasParamSpecVal : 1, alias AliasParamDefaultVal = 1, alias AliasParamSpecDefaultVal : 1 = 2, ) { } template TemplTypes( /* alias */ TypeParamSpecType : int, /* alias */ TypeParamDefaultType = int, /* alias */ TypeParamSpecDefaultType : long = int, ) { } void main() { alias a = TemplVals!(1, 1, 1); // ok alias b = TemplVals!(1); // ok alias c = TemplTypes!(int, int, int); // ok alias d = TemplTypes!(int); // ok } ----- --
Apr 28 2014