[Type Solver] Merged table looses ability to see new added values

Repo code:

local function merge<Value>(Value: Value): Value & typeof({Random = `hi`})
	return Value
end

local Something = merge({Test = 5})
Something.Add = 5
Something.

Expected:

Dynamically added values ​​would be visible after getting the type modified table, just like with a regularly created table.

Apologies, but we probably won’t be able to fix this. While Luau’s type solver is what powers autocomplete, and I can see why you’d want Add to show up in that position, it’s in tension with Luau providing errors for assigning into properties on tables that don’t exist. e.g. if I wrote:

local function get(): { Foobar: number }
end

local tbl = get()
tbl.Foobaz = 42

… I may want strict type checking to warn me that I’ve typo’d the name here, or I may want to prevent other fields from being written to the table returned by get.

One constraint of Luau is we want to use the same logic for inferring what the type of any given expression is, so there are times where we make sacrifices for one type checking mode or the other.

The exception for assigning new properties is when you create a local table literal (the type solver calls them “unsealed”) in that case we’re able to infer that you’re constructing a table line-by-line, for example:

local Something = { Test = 5 }
Something.Add = 5
Something.| -- `Add` should appear in autocomplete here.

Thanks for the explanation.
It’s sad, but I still have hope that Roblox Type Solver Team can add support for something like this.
This actually a very useful thing.