luau icon indicating copy to clipboard operation
luau copied to clipboard

`table.freeze` returns type `{+ +}` with new solver's strict mode

Open Ketasaja opened this issue 1 year ago • 1 comments

Tested on 0.627 with no errors in non-strict mode.

--!strict
type k = {
	k: string,
}

function _(): k
	return table.freeze({
		k = "",
	}) -- TypeError: Type pack '{+  +}' could not be converted into 'k'; at [0], {+  +} is not a subtype of k
end

Ketasaja avatar May 27 '24 14:05 Ketasaja

Same is for table.clone()

local test: typeof(table.clone())

karl-police avatar May 29 '24 14:05 karl-police

This is fixed.

andyfriesen avatar Jan 21 '25 21:01 andyfriesen