Related: #12311
TypeScript Version: nightly
Code
type Boxed = {
[k in string]: {value: any}
}
type Unboxed<T extends Boxed> = {
[K in keyof T]: T[K]['value']
}
Expected behavior:
Should compile since Boxed has index signature. T with constraint Boxed should also be indexable, with T[K] constrained by Boxed's value type, in this case, {value: any}
Actual behavior:
Error, Property 'value' does not exist on type 'T[K]'