Skip to content

Commit dbe71a2

Browse files
committed
Add regression test
1 parent 6ac0dbc commit dbe71a2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/cases/compiler/genericFunctionInference2.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,18 @@ const myReducer1: Reducer<MyState> = combineReducers({
1313
const myReducer2 = combineReducers({
1414
combined: combineReducers({ foo }),
1515
});
16+
17+
// Repro from #30942
18+
19+
declare function withH<T, U>(handlerCreators: HandleCreatorsFactory<T, U>): U;
20+
21+
type Props = { out: number }
22+
23+
type HandleCreatorsFactory<T, U> = (initialProps: T) => { [P in keyof U]: (props: T) => U[P] };
24+
25+
const enhancer4 = withH((props: Props) => ({
26+
onChange: (props) => (e: any) => {},
27+
onSubmit: (props) => (e: any) => {},
28+
}));
29+
30+
enhancer4.onChange(null);

0 commit comments

Comments
 (0)