Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
daurnimator opened this issue Aug 26, 2018 · 4 comments
Open

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

daurnimator opened this issue Aug 26, 2018 · 4 comments

Comments

@daurnimator
Copy link

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 ?

table.insert(l, get_source_line(v.filename, v.l))

@mascarenhas
Copy link
Collaborator

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

@daurnimator
Copy link
Author

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
Copy link
Collaborator

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

@daurnimator
Copy link
Author

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

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

mascarenhas added a commit that referenced this issue Nov 7, 2018
…ontext (#121)

* issue #119: use subject instead of rereading file when adding error context

* count lines properly even in previous versions of Lua

* improve code with suggestions from code review

* fix bugs with line iterator

* be defensive about file reads too
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants