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 Note If I change Failing type at B<Ts[P], Cs[P]>: Type 'Cs[P]' does not satisfy the constraint 'AA<T> to be just T (type A<T> = T;), all compiles just fine.
might be related #8459 which presumably growing from #8397 or even this one #3410

ha! don't downvote me, downvote the design team who is making typescript is the only language out there that sacrifices correctness for "convenience" of use, this is blatant and unprecedented
Guess what we're spending the swag budget on this year
Repro with some thing renamed / simplified a little
interface Thing { blah };
type B<C extends Thing> = { m: C };
type ThingMap<M> = {
[P in keyof M]: Thing;
};
type Failing<T, Cs extends ThingMap<T>> = {
foo: B<Cs[keyof T]>;
};
type Passing<T> = {
foo: B<ThingMap<T>[keyof T]>;
};
@RyanCavanaugh Seems like your repro is fixed now, but @Igorbek 's repro still throws an error.
https://github.com/Microsoft/TypeScript/issues/15957
... Guess what we're spending the swag budget on this year...

should be fixed in latest.
Most helpful comment
Guess what we're spending the swag budget on this year