-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
The following sample works perfectly in noImplicitAny unless I turn on strictNullChecks. In that event, the s parameter on foo seems to get an implicit any.
interface ActionsObject<State> {
[prop: string]: (state: State) => State
}
interface Options<State, Actions> {
state?: State;
view?: (state: State, actions: Actions) => any;
actions?: Actions;
}
declare function app<State, Actions extends ActionsObject<State>>(obj: Options<State, Actions>): void;
app({
state: 100,
actions: {
foo: s => s
},
view: (s, a) => null as any,
})If I make actions non-optional, then things work perfectly again.
Context: jorgebucaran/hyperapp#87
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