luau-lang/luau

Underflow for column count in luau-analyze involving a syntax and return type error in function

Opened this issue · 0 comments

As of release 0.634, the following code (with a newline at the end of it) causes the column count in luau-analyze to underflow:

local function _test(): boolean
	if true then
	-- end
end --newline after here

This causes luau-analyze to report the following:

.\underflow.luau(5,1): SyntaxError: Expected 'end' (to close 'function' at line 1), got <eof>; did you forget to close 'then' at line 2?
.\underflow.luau(5,-2): TypeError: Not all codepaths in this function return 'boolean'.

I'm unsure of how to attach the .luau file to a github report however it appears to reproduce with the most recent (as of writing) luau-windows.zip download.