As a user, coming from TypeScript, I find it extremely convenient to have literal types (for example, the type 'foo'). This allows for some much more advanced typing (in typescript), for example, events:
However, doing the same in lua is impossible, so we need to compromise type checking:
global type EventHandler = function(target: string, handle: function(val: any): nil)
I'm well aware that Typescript and Teal don't have the same design philosophies, but I would really appreciate this feature being "borrowed" from Typescript.
As a user, coming from TypeScript, I find it extremely convenient to have literal types (for example, the type
'foo'
). This allows for some much more advanced typing (in typescript), for example, events:However, doing the same in lua is impossible, so we need to compromise type checking:
I'm well aware that Typescript and Teal don't have the same design philosophies, but I would really appreciate this feature being "borrowed" from Typescript.