HaxeFoundation / HaxeFoundation/haxe

Inline temp vars regression in rc.5

Open
#8,815 6 comments 1 reaction 0 assignees View on GitHub
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

```haxe
class Test {
static var foo = new Sets();
static function main() {
var foo2 = new Sets(Std.random(3) * 2);
init(foo2);
trace(foo);
}
static inline function init(foo2:Sets) {
foo.start = foo2.start;
}
}

class Sets {
public var start = 0;
public inline function new(start = 0):Void {
this.start = start;
}
}
```
http://try-haxe.mrcdk.com/#bf1A2
Diff (with analyzer-optimize):
```diff
var start = Std.random(3) * 2;
< Test.foo.start = start;
---
> if(start == null) {
> start = 0;
> }
> var foo2_start = 0;
> foo2_start = start;
> Test.foo.start = foo2_start;
console.log("root/program/Test.hx:6:",Test.foo);
```

Contributor guide

Open the contributing guide

Research direction

The issue provides a complete Haxe reproduction and generated diff; start by running the Try Haxe link with analyzer-optimize enabled and comparing rc.5 behavior. Trace the compiler's inline-temporary handling from that reproduction, then confirm the generated output no longer shows the reported regression.

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
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.