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

Dennis <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]
           Hardware|x86_64                      |All
                 OS|Linux                       |All

--- Comment #1 from Dennis <[email protected]> ---
I reduced the example a bit:

```D
struct B
{
    int j;
    bool down() {return true;}
}

enum button
{
    shift = B(0),
    down = B(1), // without this line, it compiles
}

void main()
{
    // Error: struct `B` does not overload ()
    if (button.shift.down()) {}
}
```

This is indeed very confusing, and a result of D allowing you to access static
properties of a type using an instance of that type. I don't know if the
specification says one of them is supposed to have priority.

--

Reply via email to