HaxeFoundation / HaxeFoundation/haxe

Unroll arrays from arguments of inlined functions

Open
#7,842 2 comments 1 reaction 1 assignee Claimed by @Simn View on GitHub
enhancement feature-analyzer
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

Can we have loop unrolling in inlined functions?
```haxe
class Test {
static function main() {
test([1, 2]);
}

static inline function test(a:Array) {
for(i in a) {
trace(i);
}
}
}
```
generated output:
```js
// Generated by Haxe 4.0.0-rc.1+c951675
(function () { "use strict";
var Test = function() { };
Test.main = function() {
var a = [1,2];
var _g = 0;
while(_g < a.length) console.log("root/program/Test.hx:8:",a[_g++]);
};
Test.main();
})();
```
http://try-haxe.mrcdk.com/#9170b

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.