luau icon indicating copy to clipboard operation
luau copied to clipboard

Luau Analyze fails to infer forward declared function type

Open cipharius opened this issue 3 years ago • 0 comments

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.

cipharius avatar May 16 '22 15:05 cipharius