Skip to content

Instantly share code, notes, and snippets.

@Shilo
Created September 17, 2022 08:46
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 Shilo/8a2abf060f962d6ce3a9a134822e537f to your computer and use it in GitHub Desktop.
Save Shilo/8a2abf060f962d6ce3a9a134822e537f to your computer and use it in GitHub Desktop.
Nothing to nil casting test in LUA.
function testNil() return nil end
function testNothing() end
print( type( (testNil()) ) )
print( type( (testNothing()) ) )
print( type( testNil() ) )
print( type( testNothing() ) )
nil
nil
nil
/opt/wandbox/lua-5.4.3/bin/lua: prog.lua:7: bad argument #1 to 'type' (value expected)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment