HaxeFoundation / HaxeFoundation/haxe
[lua] inline function as param not working as expected
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
Code:
```haxe
class TestInline {
static public function main()
{
new TestInline();
}
function new()
{
var array = [0, 1, 2, 3];
this.push = this._push;
this.push(shrink(array, 2));
}
public var push:Array->Void;
function _push(array:Array)
{
trace(array); // expected [0,1], but is null on lua
}
static inline public function shrink(buf:Array, size:Int) {
if (buf.length != size) {
buf = buf.slice(0, size);
}
return buf;
}
}
```
This should output `[0,1]`, but traces `null` for the lua target.
Tested with haxe 4.0.0 @ 3018ab109, lua 5.3.4
cc @jdonaldson
Contributor guide
Assessment
This issue has not been assessed yet.