luau icon indicating copy to clipboard operation
luau copied to clipboard

[New Solver] Generic function parameters are unknown

Open natxnekk opened this issue 3 months ago • 1 comments

Sample function where this issue works:

--note: when doing `predicate: <K, V>(key: K, value: V)` the type for key and value is K and V but it doesn't take the type from the table, acts the same as if the type was 'a'
function filterDictionary<K, V>(t: {[K]: V}, predicate: (key: K, value: V) -> boolean): {[K]: V}
	local finalTable = {}
	for k, v in t do
		if predicate(k, v) then
			finalTable[k] = v
		end
	end
	return finalTable
end
Image

Note: players is a correctly typed table containing type Player version(): 0.690.0.6900721

natxnekk avatar Sep 16 '25 10:09 natxnekk

Hello! Unfortunately this is an issue with bidirectional inference that the new type solver isn't currently capable of handling. It is, however, on our roadmap to add support for over the next two months or so.

skanosue avatar Sep 17 '25 23:09 skanosue