Quote:
Originally Posted by Deather
There is also a problem with using the same struct type as a method argument type:
Code:
enum
struct STest
{
int a;
void Add(STest x)
{
a += x.a;
}
}
STest test;
|
Right, it seems you can't use same enum struct inside one's definition. Though you also need to always prefix
self members with
this. (so
this.a in your example), otherwise it's an error.
Also, I wanted to suggest. I think enum structs should support constructors, I guess it would be easy since they allow for normal functions already, and it would be the most natural next-step for me. In relation to this, the fact that methodmaps have constructors already wouldn't be a reason for not making same on enum structs - methodmaps can't contain member variables.
Once this is done, enum structs will be much more valuable.