I am pretty new to Lua and maybe this is a noobie question but why is the below code failing? As far as I understand foo returns two parameters and since in Lua you can pass as many parameters as your heart desires the first passes just fine but the second call fails the assert.
function foo()
return true, {}
end
function bar(a,b,c)
assert(type(b)=="table", "Expected table as the second parameter")
print("Fine")
end
bar(foo()) -- Fine
bar(foo(),true) -- Expected table as the second parameter