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

--- Comment #3 from LucienPe <[email protected]> ---
(In reply to elpenguino+D from comment #2)
> Incorrect. a @disabled method does not need a body, as no references to it
> are ever emitted. You can observe this for yourself by simply renaming
> toHash in the example to something without special semantics. Or by removing
> const. Even a non-@disable'd method without a body doesn't generate linker
> errors unless you try to call it.

You're right. That was a workaround :P
This bug is also valid for `toString()`.

```
struct Foo
{
        @disable size_t toHash() const nothrow @safe; // linker fail
        @disable size_t toHash(); // ok
        @disable string toString(); // linker fail
}

class Bar
{
        @disable override size_t toHash() const nothrow @safe; // linker fail
        @disable override size_t toHash(); // linker fail
        @disable override string toString(); // linker fail
}
```

--

Reply via email to