mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-06-11 10:46:28 -05:00
Add regression test
This commit is contained in:
15
tests/cases/compiler/genericFunctionInference2.ts
Normal file
15
tests/cases/compiler/genericFunctionInference2.ts
Normal 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 }),
|
||||
});
|
||||
Reference in New Issue
Block a user