Skip to content

Instantly share code, notes, and snippets.

@nogweii
Last active May 21, 2021 06:48
Show Gist options
  • Select an option

  • Save nogweii/3a814dee606413916e6532710a6155be to your computer and use it in GitHub Desktop.

Select an option

Save nogweii/3a814dee606413916e6532710a6155be to your computer and use it in GitHub Desktop.
test case in neovim for table.move
local merge_arrays = function(a, b)
local result = {unpack(a)}
table.move(b, 1, #b, #result + 1, result)
return result
end
local first = {1,2,3}
local second = {2,4,6}
merge_arrays(first, second)
-- Running :luafile % results in:
-- E5113: Error while calling lua chunk: foo.lua:3: attempt to call field 'move' (a nil value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment