[Issue 18973] @disable on const toHash causes unresolved symbol error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat May 9 15:24:04 UTC 2020


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

LucienPe <lucien.perregaux at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |lucien.perregaux at gmail.com
         Resolution|---                         |INVALID

--- Comment #1 from LucienPe <lucien.perregaux at gmail.com> ---
That has nothing to do with the @disable attribute.
It's because you need to add a body to `toHash()`.

Like this:
```

    @disable size_t toHash() const
    {
        return 0;
    }

```

For the v2.091 of DMD:

```
struct X
{
    @disable size_t toHash() const nothrow @safe
    {
        return 0;
    }
}
```

--


More information about the Digitalmars-d-bugs mailing list