TypeScript Version: 2.7.0-dev.20180118
Code
declare function conforms<T>(source: { [K in keyof T]: (val: T[K]) => boolean }): (value: T) => boolean;
conforms({ foo: (v: string) => false })({ foo: "foo" });
Expected behavior:
No error. T is inferred as { foo: string }.
Actual behavior:
T is inferred as { foo: {} }.
src/a.ts(2,10): error TS2345: Argument of type '{ foo: (v: string) => boolean; }' is not assignable to parameter of type '{ foo: (val: {}) => boolean; }'.
Types of property 'foo' are incompatible.
Type '(v: string) => boolean' is not assignable to type '(val: {}) => boolean'.
Types of parameters 'v' and 'val' are incompatible.
Type '{}' is not assignable to type 'string'.
Worked in 2.7.0-dev.20180116.
Detected in lodash on DefinitelyTyped.
TypeScript Version: 2.7.0-dev.20180118
Code
Expected behavior:
No error.
Tis inferred as{ foo: string }.Actual behavior:
Tis inferred as{ foo: {} }.Worked in 2.7.0-dev.20180116.
Detected in
lodashon DefinitelyTyped.