Skip to content

Type state prevents table key from being changed in new solver #1344

@Ketasaja

Description

@Ketasaja

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingnew solverThis issue is specific to the new solver.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions