[Issue 2294] New: negative default values for int template arguments does not work

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Aug 19 08:26:51 PDT 2008


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

           Summary: negative default values for int template arguments does
                    not work
           Product: D
           Version: 1.026
          Platform: Macintosh
        OS/Version: Mac OS X
            Status: NEW
          Keywords: link-failure, rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: fawzi at gmx.ch
OtherBugsDependingO 2291
             nThis:


something like this:
{{{
class MyClass(int startAxis1=-1){
    this() {}
}

void main(){
    MyClass!() aa=new MyClass!()();
}
}}}

fails to compile.

not using the default (either by explicit instantiation or removing it), or a
positive default value don't give any problem.

I have found this error with gdmd, and posted it as issue
http://d.puremagic.com/issues/show_bug.cgi?id=2291 (see also my attachment
there) but I have tested with codepad and also dmd fails.


-- 



More information about the Digitalmars-d-bugs mailing list