Add regression test

This commit is contained in:
Anders Hejlsberg
2019-04-10 17:13:04 -10:00
parent 4b813e310c
commit 8cd5d61644

View File

@@ -0,0 +1,15 @@
// Repro from #30685
type Reducer<S> = (state: S) => S;
declare function combineReducers<S>(reducers: { [K in keyof S]: Reducer<S[K]> }): Reducer<S>;
type MyState = { combined: { foo: number } };
declare const foo: Reducer<MyState['combined']['foo']>;
const myReducer1: Reducer<MyState> = combineReducers({
combined: combineReducers({ foo }),
});
const myReducer2 = combineReducers({
combined: combineReducers({ foo }),
});