[Issue 1100] New: Alias parameters don't accept primitive types.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Apr 5 22:58:39 PDT 2007


http://d.puremagic.com/issues/show_bug.cgi?id=1100

           Summary: Alias parameters don't accept primitive types.
           Product: D
           Version: 1.010
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: reiner.pope at gmail.com


template MyAlias(alias A)
{
    alias A MyAlias;
}

void main()
{
    alias MyAlias!(int) Myint; // This line fails: 
// template instance MyAlias!(int) does not match any template declaration
}

This disagrees with the spec
(http://www.digitalmars.com/d/template.html#aliasparameters) which says that
alias parameters can be type names -- I would certainly consider 'int' to be a
type name. Furthermore, it's unintuitive because a similar call like this works
fine:

struct Int
{
    int x;
}

void main()
{
    alias MyAlias!(Int) MyInt;
}


-- 



More information about the Digitalmars-d-bugs mailing list