TypeScript Version: 3.4.0-dev.201xxxxx
Search Terms:
Recursive
Conditional
Code
typeAction<Argsextendsany[],PayloadextendsRecord<string,any>,Textendsstring>=((...args: Args)=>(Payload&{type: T}))&{readonlytype: T}typeAnyAction=Action<any[],any,string>typeCascadingActionMap={[name: string]: AnyAction|CascadingActionMap}typeReducer<S,T>=(state: S,action: T)=>StypeCascadingActionType<T>=TextendsCascadingActionMap
? {[KinkeyofT]: ActionType<T[K]>}[keyofT]
: neverexporttypeActionType<T>=TextendsAnyAction
? ReturnType<T>
: TextendsReducer<any, infer A>
? A
: CascadingActionType<T>Expected behavior:
No errors. It's worth noting that it works in 3.3.4, with the correct derived type.
Actual behavior:
Running tsc command line, it reports the following errors:
error TS2456: Type alias 'CascadingActionType' circularly references itself.
914 type CascadingActionType<T> = T extends CascadingActionMap
~~~~~~~~~~~~~~~~~~~
error TS2315: Type 'ActionType' is not generic.
915 ? { [K in keyof T]: ActionType<T[K]> }[keyof T]
~~~~~~~~~~~~~~~~
error TS2456: Type alias 'ActionType' circularly references itself.
918 export type ActionType<T> = T extends AnyAction
~~~~~~~~~~
error TS2315: Type 'CascadingActionType' is not generic.
924 : CascadingActionType<T>
~~~~~~~~~~~~~~~~~~~~~~
Playground Link:
Related Issues:
TypeScript Version: 3.4.0-dev.201xxxxx
Search Terms:
Recursive
Conditional
Code
Expected behavior:
No errors. It's worth noting that it works in 3.3.4, with the correct derived type.
Actual behavior:
Running
tsccommand line, it reports the following errors:Playground Link:
Related Issues: