never is also said to be the bottom type, meaning there doesn’t exist a value that inhabits the type never . In fact, it is the dual of unknown . never is useful in many scenarios, and one such use case is when type refinements proves it impossible:
local function unknown(): unknown
return if math.random() > 0.5 then "hello world!" else 5
end
local x = unknown()
if typeof(x) == "number" and typeof(x) == "string" then
-- x : never
end