HaxeFoundation / HaxeFoundation/haxe

Negative enum abstract (Float) values are rejected in `-Value`

Open
#8,321 2 comments 0 reactions 0 assignees View on GitHub
feature-abstracts feature-coretype
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

```haxe
class Main {
static inline var SECOND = -2.0;

static function main() {
trace(-SECOND); // Ok
trace(-FTest); // FloatTest should be Int
trace(1 - FTest); // FloatTest should be Int
}
}

enum abstract FloatTest(Float) from Float to Float {
var FTest = -1.0;
}
```

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.