I recently found out about user-defined function documentation, wanted to add it to my modules but the documentation wouldn’t show up. After some testing I found that type casting the functions was the issue. Does anyone know a way around this without removing the type casts?
Working module:
--!strict
local MyModule = {}
-- Shows up
MyModule.MyFunction = function (): true
return true
end
return MyModule
Failing module:
--!strict
type MyModuleImpl = {
MyFunction: () -> true
}
local MyModule = {} :: MyModuleImpl
-- Doesn't show up
MyModule.MyFunction = function (): true
return true
end :: () -> true
return MyModule