[Issue 14554] New: dmd generate wrong error message for multiple template with same name
    via Digitalmars-d-bugs 
    digitalmars-d-bugs at puremagic.com
       
    Thu May  7 05:04:40 PDT 2015
    
    
  
https://issues.dlang.org/show_bug.cgi?id=14554
          Issue ID: 14554
           Summary: dmd generate wrong error message for multiple template
                    with same name
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: kozzi11 at gmail.com
// test.d
struct S {
     void foo(T)(int j) {}
     static void foo(T)(int j) {}
}
void main()
{
     S.foo!bool(1);
}
2.067:
test.d(8): Error: need 'this' for 'foo' of type '(int j)'
2.066:
test.d(8): Error: need 'this' for 'foo' of type 'pure nothrow @nogc @safe
void(int j)'
2.063:
test.d(8): Error: template test.S.foo matches more than one template
declaration, test.d(2):foo(T)(int j) and test.d(3):foo(T)(int j)
test.d(8): Error: need 'this' for 'foo' of type 'pure nothrow @safe void(int
j)'
// test2.d
struct S {
     static void foo(T)(int j) {}
     void foo(T)(int j) {}
}
void main()
{
     S.foo!bool(1);
}
2.067:
test2.d(8): Error: need 'this' for 'foo' of type '(int j)'
2.066:
test2.d(8): Error: test2.S.foo called with argument types (int) matches both:
test2.d(2):     test2.S.foo!bool.foo(int j)
and:
test2.d(3):     test2.S.foo!bool.foo(int j)
2.063:
test2.d(8): Error: template test2.S.foo matches more than one template
declaration, test2.d(2):foo(T)(int j) and test2.d(3):foo(T)(int j)
some more info:
http://forum.dlang.org/post/lyieypbmuyfumvccsxes@forum.dlang.org
--
    
    
More information about the Digitalmars-d-bugs
mailing list