luau
luau copied to clipboard
[New Solver] Generic function parameters are unknown
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
Note: players is a correctly typed table containing type Player version(): 0.690.0.6900721
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.