luau
luau copied to clipboard
Table type refinement drops sibling keys
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