Closed JamDon2 closed 2 years ago
The type definitions still work as expected in my tests.
Check that you don't have a file also named exactly util
(.ts or .lua) in the root folder of your mod. If so, lua will import that file instead of the factorio lualib file. You can get around this by renaming the util
file (e.g. to _util.ts
) or moving it into a folder.
If there's still an issue, more information or a sample project would be useful to reproduce this.
That was the case, the build folder wasn't being deleted before a new build, and a util.lua file remained.
I'm trying to use table.deepcopy, this is what I tried so far:
The above code gets transpiled into this:
The variable
____table
is nil in the Lua code. How can I extend the table type with the table namespace from util?