As shown in the following screenshot, the new solver correctly resolves the type of HumanoidStateTypes in HumanoidStateTypes.Freefall (line 24) but resolves the type of HumanoidStateTypes to never on subsequent attempts to use the variable (lines 26 & 28).
According to Drakontas on the Roblox OSS Discord server (alexmccord), this is because:
it's intersecting Enum.HumanoidStateType.Freefall which is of type Enum.HumanoidStateType by a table (that should be viewed as a shape type) with Freefall property and intersecting a class type by a shape type shouldn't result in never, so i think this is a bug in simplification
Here's a minimal repro with a different Enum:
-- assume roblox dev environment with FFlag DebugLuauDeferredConstraintResolution = true
local UserInputTypes = Enum.UserInputType -- hover shows: local UserInputTypes: Enum.UserInputType
local function handleInputType(someInputType: Enum.UserInputType)
if someInputType == UserInputTypes.Focus then -- hover shows: local UserInputTypes: Enum.UserInputType
print("client tabbed in")
elseif someInputType == UserInputTypes then -- hover shows: local UserInputTypes: never
end
end
(edits: fixed screenshot (Enum.HumanoidStateType.Walking doesnt exist), line number)
As shown in the following screenshot, the new solver correctly resolves the type of
HumanoidStateTypes
inHumanoidStateTypes.Freefall
(line 24) but resolves the type ofHumanoidStateTypes
tonever
on subsequent attempts to use the variable (lines 26 & 28).According to Drakontas on the Roblox OSS Discord server (alexmccord), this is because:
Here's a minimal repro with a different
Enum
:(edits: fixed screenshot (
Enum.HumanoidStateType.Walking
doesnt exist), line number)