HaxeFoundation / HaxeFoundation/haxe
Enum abstract values can be typed as the underlying type
Open
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
It's currently possible to type enum abstract values as the underlying type if there's a `from`, which seems like a strange misuse that can unfortunately be found in some codebases...
```haxe
function main() {
switch Test.Foo {
case "":
}
}
enum abstract Test(String) from String {
var Foo:String;
}
```
Nothing is ever typed as `Test` here.
Contributor guide
Assessment
This issue has not been assessed yet.