www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12675] New: alias parameter with a specAlias which is a type

https://issues.dlang.org/show_bug.cgi?id=12675

          Issue ID: 12675
           Summary: alias parameter with a specAlias which is a type is
                    not properly implemented
           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 TemplType(
    /* alias */ TypeParamSpecType : int
) { }

template TemplAlias(
    alias AliasParamSpecType : int
) { }

void main()
{
    alias a = TemplType!int;   // ok
    alias b = TemplAlias!int;  // error
}
-----

Note that it works when specAlias is a value and not a type:

-----
template TemplValue(
    int x : 2
) { }

template TemplAlias(
    alias x : 2
) { }

void main()
{
    alias a = TemplValue!2;   // ok
    alias b = TemplAlias!2;  // ok
}
-----

--
Apr 28 2014