luau-lang/luau

Type state prevents table key from being changed in new solver

Opened this issue · 0 comments

Tested on 0.635, with no errors in non-strict mode.

--!strict
type t = {
	value: string?,
}

local t: t = {}

if not t.value then
	t.value = "" -- TypeError: Type 'string' could not be converted into 'nil'
end

local s: string? = nil

if not s then
	s = ""
end