Johannes Totz:

> class EnumType
> {
>       int     x;
>       alias x this;
> 
>       this(int i)
>       {
>               x = i;
>       }
> 
>       void opCall(int i)
>       {
>       }
> }
> 
> enum X : EnumType
> {
>       a = EnumType(1),
>       b = 2
> }
> 
> 
> Errors range are always variations of
> 
> main.d(16): Error: function main.EnumType.opCall need 'this' to access 
> member opCall

The error message suggests you to use a static opCall.
And are you sure you want a class instead of a struct?

Bye,
bearophile

Reply via email to