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

Parentheses should not be removed from around calls to select() with varargs #51

Closed
moody opened this issue Jan 1, 2018 · 0 comments
Closed

Comments

@moody
Copy link

moody commented Jan 1, 2018

When minified, (select(n, ...)) becomes select(n,...).
This causes errors in some situations, such as below:

local t = {}

local function a(...)
  print("Inserting:", (select(1, ...)))
  table.insert(t, (select(1, ...))) -- properly inserts "hello" into t

  print("Inserting:", select(1,...))
  table.insert(t, select(1,...)) -- calls insert(t, "hello", "world") which fails
end

a("hello", "world")

Output:

Inserting:	hello
Inserting:	hello	world
input:8: bad argument #2 to 'insert' (number expected, got string)
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

Successfully merging a pull request may close this issue.

1 participant