HaxeFoundation / HaxeFoundation/haxe

Enum abstract values can be typed as the underlying type

Open
#9,550 1 comment 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.