When trying to index the parameter of type <T,A>{[A]:T}|Instance, there is an incorrect error message:
Expected type table, got 'Instance | { [A]: T }' instead
Reproduction:
--!strict
local function getVOfT<T,A>(a:{[A]:T}|Instance,i:A) : T
return a[i]
end
Expected behavior
type error:
Attempting a dynamic property access on type '{[A]:T}|Instance' is unsafe and may cause exceptions at runtime
A private message is associated with this bug report