HaxeFoundation / HaxeFoundation/haxe

`-D no-inline` breaks inline variables

Open
#12,170 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

When used with switches (possibly other places), inline variables are not always treated as constants when `-D no-inline` is used. I would not expect this flag to impact whether code compiles or not. I also wouldn't expect the flag to do anything at all to inline variables IMO.

```haxe
final class Main {
static inline final A = 1;
static inline final B = 1 << 1; // allowed with -D no-inine, but breaks in the switch statement
static inline final C = A | B;

static function main() {
switch 5 {
case A:
case B: // Unknown identifier : B, pattern variables must be lower-case or with `var ` prefix
case C: // Unknown identifier : C, pattern variables must be lower-case or with `var ` prefix
default:
}
}
}
```

Also, it would be nice to be able to pass compiler flags into `try haxe` - similar to a site like godbolt.

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.