luau icon indicating copy to clipboard operation
luau copied to clipboard

Table type refinement drops sibling keys

Open Waffle3z opened this issue 3 months ago • 0 comments

type refinement should not erase unrelated fields

local t: unknown = {a = true, b = true}
if type(t) == "table" then
    if t.a and t.b then -- TypeError: Key 'b' not found in table '{ read a: ~(false?) }'
        print("hello")
    end
end

Waffle3z avatar Sep 03 '25 20:09 Waffle3z