HaxeFoundation / HaxeFoundation/haxe
abstract @:to conversion is not triggered within boolean operation
Open
bug
feature-abstracts
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
```haxe
abstract A(Int) from Int to Int {
@:to function toBool() return this != 0;
}
class Test {
static function main() {
var i:A = 1;
i && false; // A should be Bool
!i; // A should be Bool
if (i) trace(""); // works
}
}```
Contributor guide
Assessment
This issue has not been assessed yet.