andremm / typedlua

An Optional Type System for Lua
565 stars 53 forks source link

General trouble with fn's with option arguments? #29

Closed raould closed 9 years ago

raould commented 9 years ago

Please see https://github.com/raould/typedlua/tree/master/QUESTIONS/4 where I am trying to use table.insert( t, elem ) rather than table.insert( t, #t, elem ) But I do not know how to make that pass through tlc unfortunately.

andremm commented 9 years ago

You need #t + 1 while calling table.insert because this is an overloaded function, but Typed Lua is set to handle the case that you give the position where the element should be inserted.