typedlua icon indicating copy to clipboard operation
typedlua copied to clipboard

table types do not accept userdata as keys

Open hishamhm opened this issue 10 years ago • 1 comments
trafficstars

I tried to declare a table of type { file : {string} } and got a syntax error.

hishamhm avatar Mar 02 '15 12:03 hishamhm

I tried to declare a table of type { file : {string} } and got a syntax error.

This table type is not valid in Typed Lua. The type of the keys in a table type can only be literal types, base types, or the top type value.

In this case, you need to use { value : {string} }.

andremm avatar Mar 02 '15 19:03 andremm