luau
luau copied to clipboard
`typeof` with invalid `setmetatable` arguments and a table intersection crashes new solver's strict mode
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
This crashes with the statement
type x = setmetatable({} :: {}... as well
Leaving this here because it's likely the same underlying bug.
We have a fix for this issue prepared internally for the next sync.
This has been fixed in the sync before the last one https://github.com/luau-lang/luau/pull/1458