luau
luau copied to clipboard
Luau Analyze fails to infer forward declared function type
Posting this as bug, because the support for forward declared type inference is there, but it doesn't work for different case of function definition syntax.
Example of luau-analyze --annotate from latest master branch revision:
local a:free
do
function a(message: string): ()
print(message)
end
end
local b:(string)->()
do
b = function(message: string): ()
print(message)
end
end
Here b is successfully inferred, while a which uses different function definition syntax fails to get inferred correctly.