Improving Autocompletions
Sometimes, you might notice that the type solver is having problems to infer the type of self
when you define a lifecycle event. There's a workaround to have autocompletions without compromising functionality:
function Service.start(self: typeof(Service))
-- self now has a type!
end
With this method, you give self an explicit type using the typeof
type function.
Last updated