Closed
Description
when indexing into a mapped type using a key that is constraint to the same constraint type, indexing should be allowed. consider:
type Optional<T> = {[K in keyof T]?: T[K]};
function setFromOther<T, K extends keyof T>(obj: T, k: K, other: Optional<T>) {
obj[k] = other[k]; // K is not constraint to keyof Optional<T>
}