- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.1k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
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.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue