-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Closed
Labels
Needs InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.
Description
TypeScript Version: master
Search Terms:
Code
declare function f<T extends object>(data: T, handlers: { [P in keyof T]: (value: T[P], prop: P) => void; }): void;
f({ data: 0 }, {
data(value, key) {
},
});Should also work with optional.
declare function f<T extends object>(data: T, handlers: { [P in keyof T]?: (value: T[P], prop: P) => void; }): void;
f({ data: 0 }, {
data(value, key) {
},
});Expected behavior:
pass
Actual behavior:
$ node built/local/tsc.js --strictNullChecks --noImplicitAny index.ts
index.ts:3:8 - error TS7006: Parameter 'value' implicitly has an 'any' type.
3 data(value, key) {
~~~~~
index.ts:3:15 - error TS7006: Parameter 'key' implicitly has an 'any' type.
3 data(value, key) {
~~~
Playground Link:
Related Issues:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Needs InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.