HaxeFoundation / HaxeFoundation/haxe

Getter + increment haxe.Int64 variable compile error

Open
#11,605 7 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

Recently, the following example does not compile, with message "haxe.Int64 should be Int". However, we should be able to increment an `haxe.Int64` value. Without getter or without increment, the code compile correctly.
```haxe
static var uid(get,default) : haxe.Int64;
static var __uid : haxe.Int64 = 0;
static inline function get_uid():haxe.Int64 return __uid;
static var uid2 : haxe.Int64 = 0;

static public function main() {
uid++; // Error "haxe.Int64 should be Int"
uid += 1; // Ok
uid2++; // Ok
}
```

The first bad commit is https://github.com/HaxeFoundation/haxe/commit/a57c74c770e986f6bbd40c350af6e1bae65abf0b which is also related to the issue about setter and increment https://github.com/HaxeFoundation/haxe/issues/11577

Contributor guide

Open the contributing guide

Research direction

Start with the provided Haxe reproduction and inspect the first bad commit a57c74c770e986f6bbd40c350af6e1bae65abf0b. Compare the getter-backed `uid++` case with `uid += 1` and `uid2++`, then review related issue #11577. Done means the example compiles without the `haxe.Int64 should be Int` error.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.