Failed to build: `attempt to index a nil value (field 'emptytable_type')`
cyan build
Warn in config:
... Unknown key 'aot_options'
Info Type checked src/module.tl
Info Type checked src/nested/module.tl
Error Error executing command
... ...ocuments/teal-to-native/lua_modules/share/lua/5.4/tl.lua:7351: attempt to index a nil value (field 'emptytable_type')
... stack traceback:
... ...ocuments/teal-to-native/lua_modules/share/lua/5.4/tl.lua:7351: in upvalue 'assert_is_a'
... ...ocuments/teal-to-native/lua_modules/share/lua/5.4/tl.lua:9182: in local 'cbkind_after'
... ...ocuments/teal-to-native/lua_modules/share/lua/5.4/tl.lua:3629: in upvalue 'recurse'
... ...ocuments/teal-to-native/lua_modules/share/lua/5.4/tl.lua:3436: in local 'fn'
... ...ocuments/teal-to-native/lua_modules/share/lua/5.4/tl.lua:3621: in upvalue 'recurse'
... ...ocuments/teal-to-native/lua_modules/share/lua/5.4/tl.lua:3552: in local 'fn'
... ...ocuments/teal-to-native/lua_modules/share/lua/5.4/tl.lua:3621: in upvalue 'recurse'
... ...ocuments/teal-to-native/lua_modules/share/lua/5.4/tl.lua:3436: in local 'fn'
... ...ocuments/teal-to-native/lua_modules/share/lua/5.4/tl.lua:3621: in function <...ocuments/teal-to-native/lua_modules/share/lua/5.4/tl.lua:3599>
... (...tail calls...)
... ...ocuments/teal-to-native/lua_modules/share/lua/5.4/tl.lua:10430: in function 'tl.type_check'
... (...tail calls...)
... ...native/lua_modules/share/lua/5.4/cyan/commands/build.lua:161: in local 'process_node'
... ...native/lua_modules/share/lua/5.4/cyan/commands/build.lua:198: in field 'exec'
... ...ts/teal-to-native/lua_modules/share/lua/5.4/cyan/cli.lua:170: in function <...ts/teal-to-native/lua_modules/share/lua/5.4/cyan/cli.lua:169>
... [C]: in function 'xpcall'
... ...ts/teal-to-native/lua_modules/share/lua/5.4/cyan/cli.lua:169: in main chunk
... [C]: in function 'require'
... ...lua_modules/lib/luarocks/rocks-5.4/cyan/0.3.0-1/bin/cyan:2: in main chunk
... [C]: in ?
Error: Build error: Failed building.
This only happens when I have a .lua file in my src, I have an appropriate .d.tl to go along with it aswell
It seems cyan tries to compile all lua files too, which is unexpected. I found a workaround, which is to use include to restrict the compiled files only to .tl:
include = {"**/*.tl"}
It seems cyan tries to compile all lua files too, which is unexpected. I found a workaround, which is to use
includeto restrict the compiled files only to.tl:include = {"**/*.tl"}
Nice! I ended up just writing my own build stuff off cyan though lol https://github.com/Frityet/teal-to-native/blob/cyan-build/scripts/aot-compile.tl
This seems to be an error in the teal compiler. Are you still able to reproduce this? It would be nice to send a report over there if you can.