luau icon indicating copy to clipboard operation
luau copied to clipboard

`typeof` with invalid `setmetatable` arguments and a table intersection crashes new solver's strict mode

Open nothing1649 opened this issue 1 year ago • 1 comments

As of version 0.642, the following code in the new solver's strict mode causes the linter to crash completely, becoming unresponsive and replacing all type errors with a "subtyping test returned invalid path" error.

--!strict
type self = {} & {}
type Class = typeof(setmetatable())
local function _(): Class
	return setmetatable({}::self, {}) --Subtyping test returned a reasoning with an invalid path
end

nothing1649 avatar Sep 13 '24 06:09 nothing1649

This crashes with the statement

type x = setmetatable({} :: {}... as well

Leaving this here because it's likely the same underlying bug.

metatablecat avatar Sep 28 '24 03:09 metatablecat

We have a fix for this issue prepared internally for the next sync.

vegorov-rbx avatar Oct 01 '24 12:10 vegorov-rbx

This has been fixed in the sync before the last one https://github.com/luau-lang/luau/pull/1458

vegorov-rbx avatar Oct 14 '24 17:10 vegorov-rbx