If I call opDispatch with a name that is also a type inside a with
statement, I get an error.
enum Suit { clubs, spades, hearts, diamonds }
struct Card {
void opDispatch(string s)(.Suit) {}
}
void main() {
Card c;
with (c) Suit = .Suit.diamonds; // Error: `Suit` is not an lvalue and cannot be modified
}
Is this a bug? It compiles without error if I call opDispatch!"Suit" directly.