[Issue 3345] Static and nonstatic methods with the same name should be allowed
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Jul 29 11:06:22 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=3345
--- Comment #10 from Max Samukha <maxsamukha at gmail.com> ---
(In reply to Basile-z from comment #8)
> considering that the `this` parameter is not part of the signature it's
> indeed reasonable not to support static and nonstatic in the same set.
>
> ```
> struct S
> {
> void v1(){}
> static void v2(){}
>
> alias Fun = void();
>
> static assert(is(typeof(v1) == Fun));
> static assert(is(typeof(v2) == Fun));
> }
> ```
I wouldn't use the broken type system as a rationale. Static and non-static
function types should have never been equal.
--
More information about the Digitalmars-d-bugs
mailing list