HaxeFoundation / HaxeFoundation/haxe
Can't bind extern inline function
Open
enhancement
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
```haxe
class Main {
static function main() {
var f = new Foo();
var v = 1;
var bound = f.bar.bind(v); // Error: Can't create closure on an extern inline member method
// maybe the compiler can generate the following which should be equivalent?
var bound = {
final _f = f;
final _v = v;
function() _f.bar(_v);
}
bound(); // 1
v = 2;
bound(); // 1
}
}
class Foo {
public function new() {}
@:extern public inline function bar(v:Int) {
trace(v);
}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.