Closed
Description
As said in the title, the simplified code below is not accepted.
typedef Index = (int y, int x);
void main() {
var (int y, int x) = (1, 3);
var (bool reset, (int, int, int)? color) = switch ((y, x)) {
Index ind when ind != ind => (true, (0, 128, 128)),
_ => (false, null),
};
}
Removing the question mark parses correctly, or by creating a type alias works as well.
typedef Index = (int y, int x);
typedef Color = (int r, int g, int b);
void main() {
var (int y, int x) = (1, 3);
var (bool reset, Color? color) = switch ((y, x)) {
Index ind when ind != ind => (true, (0, 128, 128)),
_ => (false, null),
};
}