Type CASTED unions don't refine correctly

--!strict

local c_array: {false | CFrame} = {false, CFrame.new(0, 0, 0), false, CFrame.new(0, 0, 0)}
local c = false :: CFrame | false
local y: CFrame | false = false
local z = c_array[1]

if z then
	
	z:ToObjectSpace(CFrame.new(0, 1, 2)) -- Type error since c is resolved as CFrame | true despite type refining to CFrame with the if statement
end

if c then

	c:ToObjectSpace(CFrame.new(0, 1, 2)) -- Also a type error
end

if y then

	y:ToObjectSpace(CFrame.new(0, 1, 2)) -- Succesfully type refines to CFrame
end

Expected behavior

vars c and z should be resolved as CFrame within the if statements

1 Like

This is just an acknowledgment announcement!

We’ve filed a ticket into our internal database for this issue, and we will update you when we have further information!

Thanks for the report!