How can overloads be distinguished on attributes alone?

bachmeier no at spam.net
Mon Jul 31 16:09:11 UTC 2023


On Monday, 31 July 2023 at 12:17:34 UTC, Dennis wrote:

> The duplicate definition check doesn't consider whether a 
> function is actually unambiguously callable (without e.g. 
> traits getOverloads), it only prevents creating the same linker 
> symbol multiple time. So you can even do this:
>
> ```D
>           void f() { }
> extern(C) void f() { }
> ```

Is there a reason it would be difficult to make this not compile? 
There's no case in which it's a legitimate program AFAICT.


More information about the Digitalmars-d-learn mailing list