Comment #0 by pro.mathias.lang — 2020-02-19T09:12:42Z
The following code:
```
void main () nothrow
{
foo("hello");
}
void foo (string) @system nothrow {}
void foo (string) @safe { }
```
Results in the following error message:
```
test.d(3): Error: test.foo called with argument types (string) matches both:
test.d(6): test.foo(string)
and:
test.d(7): test.foo(string)
```
But when changing the definition of `foo` to:
```
void foo (string, float f = 42) @system nothrow {}
void foo (string, int a = 42) @safe { }
```
We get:
```
test.d(6): Error: function nope.foo is not nothrow
test.d(1): Error: nothrow function D main may throw
```
Which, if a user expect overloading to work with different attributes, is confusing.
Comment #1 by robert.schadek — 2024-12-13T19:07:08Z