HaxeFoundation / HaxeFoundation/haxe
enum abstract, array matching and exhaustiveness bug
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
This code does not compile with error message: `Unmatched patterns: false`.
Similar code but with `enum` instead of `enum abstract` compiles and works fine.
```haxe
@:enum abstract EFoo(Int) {
var Foo=1;
var Bar=2;
var FooBar=3;
}
class Test {
static function test(foo: EFoo, flag: Bool): String {
return
switch [foo, flag] {
case [Foo, _]: "Foo *";
case [_, true]: "* true";
case [Bar, _]: "Bar false";
case [FooBar, _]: "FooBar false";
}
}
static function main() {
trace(test(Bar, true));
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.