Using the new type solver fails on degenerate cases when type checking
For example, in Roblox, the following code causes a type error:
--!strict
local function foo(player: Player)
if player and player.Character and player.Character:FindFirstChild("Humanoid") then
local humanoid = player.Character:FindFirstChildWhichIsA("Humanoid")
assert(humanoid, `Failed to find {player.Character:GetFullName()}.Humanoid`)
if player.Character:HasTag("someTag") then
player.Character:FindFirstChild("RagdollConstraints"):Destroy()
end
end
end
Hovering over player inside the innermost if statement indicates the type is inferred as
refine<never, {
Character: *blocked-5951724*
}>
Cannot call a value of type 'blocked-5951699'
Using the new type solver fails on degenerate cases when type checking
For example, in Roblox, the following code causes a type error:
Hovering over
player
inside the innermost if statement indicates the type is inferred as