andremm / typedlua

An Optional Type System for Lua
563 stars 53 forks source link

tlchecker.lua:2009: wrong number of arguments to 'insert' #119

Open daurnimator opened 5 years ago

daurnimator commented 5 years ago
lua: /usr/share/lua/5.3/typedlua/tlchecker.lua:2009: wrong number of arguments to 'insert'
stack traceback:
    [C]: in function 'table.insert'
    /usr/share/lua/5.3/typedlua/tlchecker.lua:2009: in function 'typedlua.tlchecker.error_msgs'
    /usr/bin/tlc:140: in main chunk
    [C]: in ?

https://github.com/andremm/typedlua/blob/002f983936cfb08cbebe52ff0330e2d68b9ece9b/typedlua/tlchecker.lua#L2009

mascarenhas commented 5 years ago

Could you provide more context around the error (ideally, a source file that compiled with tlc triggers it).

daurnimator commented 5 years ago

I dug into it a little more: the issue was caused by me providing a non-seekable file to tlc. When it tried to get the source line it fails as it can't re-read the file.

mascarenhas commented 5 years ago

Thanks! Can you pull from the branch referenced in this issue to check if it fixes your issue?

daurnimator commented 5 years ago

Indeed your branch seems to fix things! I tested with the simple:

./tlc  -o /dev/stdout <(echo 'local hi:number = "foos"')