[Issue 5686] New: class template error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 2 21:07:02 PST 2011


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

           Summary: class template error
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: changlon at gmail.com


--- Comment #0 from changlon <changlon at gmail.com> 2011-03-02 21:04:08 PST ---
test.d
--------------------------
ptrdiff_t Test1( string file = __FILE__, ptrdiff_t line = __LINE__)(){
    static assert( line != __LINE__ -1 );
    return line ;
}

class Test2(string name,  string file = __FILE__, ptrdiff_t line = __LINE__){
    static assert( line != __LINE__ -1 );
    int i    = 1;
    this(){

    }
}
void main(){
    auto test1 = Test1();
    auto test2 = new Test2!("test") ;
}
---------------------------------
test.d(8): Error: static assert  (7 != 7) is false
test.d(17): instantiated from here: Test2!("test")

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list