[Issue 20777] User defined type as enum base type fails to compile.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Apr 6 13:27:23 UTC 2021


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

Paul Backus <snarwin+bugzilla at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |snarwin+bugzilla at gmail.com
            Summary|User defined types as       |User defined type as enum
                   |anonymous enums basetype,   |base type fails to compile.
                   |fail to compile.            |
           Severity|enhancement                 |normal

--- Comment #1 from Paul Backus <snarwin+bugzilla at gmail.com> ---
Simplified example:

---
struct fooint
{
    int i;
    auto opBinary(string op : "+")(int j)
    {
        return fooint(i + j);
    }

    @property fooint max()
    {
        return fooint(int.max);
    }
}

enum foolist { hi = fooint(0), bye }
---

Produces the following error message:

---
Error: no property `max` for type `fooint`, did you mean
`onlineapp.fooint.max`?
---

--


More information about the Digitalmars-d-bugs mailing list