Closed
Description
TypeScript Version: 2.1.4 / nightly (2.2.0-dev.20161219)
Code
type A<T> = () => T;
type B<T, C extends A<T>> = C;
type As<Ts> = {
[P in keyof Ts]: A<Ts[P]>;
};
type Failing<Ts, Cs extends As<Ts>> = {
[P in keyof Ts]: B<Ts[P], Cs[P]>;
// ~~~~~ Type 'Cs[P]' does not satisfy the constraint 'A<Ts[P]>'.
};
Expected behavior:
No errors, the constraint has been proven
Actual behavior:
Error in Failing
type at B<Ts[P], Cs[P]>
: Type 'Cs[P]' does not satisfy the constraint 'A<Ts[P]>'.
Note
If I change A<T>
to be just T
(type A<T> = T;
), all compiles just fine.