by 90s_dev · 1y ago · 0 comments
My main gripe with Lua (and thus Luau) is colons. It's so easy to forget them. Does the type checker catch this error? And if so, does it catch it every time, provided you always use types? If so, that could be good enough for me. Especially if it has strong LSP + VS Code support.
Unless you're using metatables, this would just be manually defining `self` with a type containing the fields you want it to represent.
For example:
```luau local Module = {} export type Module = { field: string }
function Module.Something(self: Module) print(self.field) end
return Module ```
EDIT: oops, new to this site; expected codeblocks to be a thing :p
I'd check for myself but Luau's web demo seems to lack the most important feature of their dialect, type checking.
Since you're here: Is it reasonably feasible for users to add declaration files for code exported from the host application? The lack of documentation got me stuck the last time I tried to embed Luau. Aside from that, I'm very excited about it!
Lua has a type checker?