Closed
Description
I think, the following code should not compile:
enum A { foo, bar }
enum B { foo, bar, baz }
void main() {
final x = A.foo;
print(x == B.foo ? '$x == B.foo' : '$x != B.foo');
}
... because it makes no sense to compare x
(an instance of enum A
) with an instance of enum B
.
Link to the example in DartPad
- Dart SDK 2.19.6