Skip to content

Instantly share code, notes, and snippets.

@nogweii
Last active May 21, 2021 06:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nogweii/3a814dee606413916e6532710a6155be to your computer and use it in GitHub Desktop.
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)
:version
NVIM v0.5.0-dev+1339-g5d9c56012
Build type: RelWithDebInfo
LuaJIT 2.0.5
Compilation: /usr/bin/cc -D_FORTIFY_SOURCE=2 -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -Og -g -W
all -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla
-fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIB
I_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/build/neovim-git/src/build/config -I/build/neovim-git/src/neovim-git/src -I/usr/include -I/build/neovim-git/src
/build/src/nvim/auto -I/build/neovim-git/src/build/include
Compiled by builduser
Features: +acl +iconv +tui
See ":help feature-compile"
system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/share/nvim"
Run :checkhealth for more info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment