richardhundt / shine

A Shiny Lua Dialect
Other
231 stars 18 forks source link

Type-safe assignments for table elements #60

Open romix opened 10 years ago

romix commented 10 years ago

The same trick as described in the following article could be implemented for Shine, most likely as a library: http://www.nczonline.net/blog/2014/04/29/creating-type-safe-properties-with-ecmascript-6-proxies/

The idea is that any new value associated with a given key should have the same type as the previous value, if there was any.