Missing compile-time type check for flag enum contains (`in`) expression
The following gives no compile-time error, but seems to give the correct run-time behaviour:
[Flags] enum EnumA { ONE, TWO; }
[Flags] enum EnumB { ONE, TWO; }
void main() {
EnumA a = ONE;
// this assertion compiles but does not get triggered at runtime
assert(EnumB.ONE in a);
}
I would expect the compiler to give a type error for the in
expression - while I know they are int's under the hood, valac knows the higher-level types.