HaxeFoundation / HaxeFoundation/haxe
Error when using macro on inline local function
Open
bug
platform-macro
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
This code fails with `Cannot create closure on inline closure`
```haxe
using Test.Macros;
class Macros {
macro public static function call (f:haxe.macro.Expr) return macro $f();
}
#if !macro
function main () {
inline function eq () {
trace("i am inline");
}
eq.call();
}
#end
```
Moving the closure into the top level works as expected:
```haxe
using Test.Macros;
class Macros {
macro public static function call (f:haxe.macro.Expr) return macro $f();
}
#if !macro
inline function eq () {
trace("i am inline");
}
function main () {
eq.call();
}
#end
```
Contributor guide
Assessment
This issue has not been assessed yet.