HaxeFoundation / HaxeFoundation/haxe

constant expressions not allowed in switch cases

Open
#6,931 7 comments 0 reactions 0 assignees View on GitHub
feature-pattern-matching
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

Constant expressions don't appear to be allowed as valid switch cases.

```haxe
class Test {
static function main() {
var i=5;
switch(i) {
case (1+5): return;
}
}
}
```
Build failure
Test.hx:5: characters 21-26 : Unrecognized pattern: (1 + 5)

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.