HaxeFoundation / HaxeFoundation/haxe
Exhaustiveness checks thrown off by enum abstract with only null value
Open
feature-pattern-matching
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
Weird edge case incoming:
```haxe
import haxe.ds.Option;
class Test {
static function main() {
switch Some(Working) {
case Some(Working | Somehow): // fine
case None:
}
switch Some(Broken) {
case Some(Broken): // [ERROR] Unmatched patterns: Some(_)
case None:
}
}
}
enum abstract Working(Null) {
var Working = null;
var Somehow = 123;
}
enum abstract Broken(Null) {
var Broken = null;
}
```
Contributor guide
Assessment
This issue has not been assessed yet.