www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19569] New: overload resolution not right?

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

          Issue ID: 19569
           Summary: overload resolution not right?
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: turkeyman gmail.com

So, I understand we can overload on `nothrow`

For instance, this works:

 void foo();
 void foo() nothrow;

 void test()
 {
    foo();
 }
 void test() nothrow
 {
     foo();
 }


But if `foo` take a template argument, it breaks down:

 void foo(T)();
 void foo(T)() nothrow;

 void test()
 {
     foo!int();
 }
 void test() nothrow
 {
     foo!int();
 }

 Error: called with argument types `()` matches both:
   `foo!int.foo()`
 and:
   `foo!int.foo()`
I feel like this is a bug...? --
Jan 09