Like fr… how the HELL do you type like… ANY Table… Like a list, a dictionary and nested lists and dictionaries, so that the new type solver knows what you mean. It would also be nice if i could use Generics like this:
type TableType<E, K> = *idk wth too put here... :/*
-- Element ^ ^ Key
Shouldn’t it be l[1], l[2], etc. instead of l["string"]? Your definition of TableType takes the element first and key second; not the other way around.
As long as you don’t care about the specifics of the type {[any]: any} might be what you’re looking for.
function AcceptsAnyTable(x: {[any]: any})
--You can still test for indexers, such as the following:
local y = x[1]
local z = x["key"]
end
--All the following calls are fine under strict type checking:
AcceptsAnyTable({})
AcceptsAnyTable({1, 2, 3, 4, 5})
AcceptsAnyTable({1, "two", 3, "four", Color3.new(5, 0, 0)})
AcceptsAnyTable({
key1 = {
v1 = 1,
v2 = 2
},
key2 = "value"
})
Let me know if this doesn’t work under a particular circumstance or you’re looking for some other behavior.