HaxeFoundation / HaxeFoundation/haxe

conditional flag evaluating to true when define doesn't exist

Open
#12,036 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

https://try.haxe.org/#43ddf946
I have a haxelib called 'db-core'

```hx
class Test {
static function main() {
#if "db-core" //same issue occurs with "db_core"
trace("db core is found");
#else
trace("db core not found");
#end
}
}
```

Outputs:
```
db core is found
```

Edit:
Actual solution is meant to be `#if db_core` but should the above still be evaluating to true?

Contributor guide

Open the contributing guide

Research direction

Reproduce the behavior from the linked try.haxe.org example using the shown #if "db-core" and #if db_core forms. Trace how conditional-compilation expressions handle quoted, undefined names, then establish whether the observed result is intended and verify the chosen behavior with a regression test.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.