{ constructor(props: P); props: P; }
+declare class GenericComponent = string & { attachPayloadTypeHack?: P & never }
+
+type Handler
+ handler: Handler , handler: Handler (x: P, callback: R[P]): void;
+};
+
+declare var x: O;
+x.on('a', a => {});
+
+// #29775
+
+namespace N1 {
+
+declare class Component {
+ constructor(props: P);
+}
+
+interface ComponentClass {
+ new (props: P): Component ;
+}
+
+type CreateElementChildren =
+ P extends { children?: infer C }
+ ? C extends any[]
+ ? C
+ : C[]
+ : unknown;
+
+declare function createElement (
+ type: ComponentClass ,
+ ...children: CreateElementChildren
+): any;
+
+declare function createElement2 (
+ type: ComponentClass ,
+ child: CreateElementChildren
+): any;
+
+class InferFunctionTypes extends Component<{children: (foo: number) => string}> {}
+
+createElement(InferFunctionTypes, (foo) => "" + foo);
+
+createElement2(InferFunctionTypes, [(foo) => "" + foo]);
+
+}
+
+// #30341
+
+type InnerBox { constructor(props: P); props: P; }
+>Component : Symbol(Component, Decl(instantiateContextualTypes.ts, 17, 1))
+>P : Symbol(P, Decl(instantiateContextualTypes.ts, 18, 24))
+>props : Symbol(props, Decl(instantiateContextualTypes.ts, 18, 41))
+>P : Symbol(P, Decl(instantiateContextualTypes.ts, 18, 24))
+>props : Symbol(Component.props, Decl(instantiateContextualTypes.ts, 18, 51))
+>P : Symbol(P, Decl(instantiateContextualTypes.ts, 18, 24))
+
+declare class GenericComponent = string & { attachPayloadTypeHack?: P & never }
+>ActionType : Symbol(ActionType, Decl(instantiateContextualTypes.ts, 29, 33))
+>P : Symbol(P, Decl(instantiateContextualTypes.ts, 33, 16))
+>attachPayloadTypeHack : Symbol(attachPayloadTypeHack, Decl(instantiateContextualTypes.ts, 33, 31))
+>P : Symbol(P, Decl(instantiateContextualTypes.ts, 33, 16))
+
+type Handler
+>actionType : Symbol(ActionHandler.actionType, Decl(instantiateContextualTypes.ts, 39, 31))
+>ActionType : Symbol(ActionType, Decl(instantiateContextualTypes.ts, 29, 33))
+>P : Symbol(P, Decl(instantiateContextualTypes.ts, 39, 26))
+
+ handler: Handler , handler: Handler (x: P, callback: R[P]): void;
+>on : Symbol(on, Decl(instantiateContextualTypes.ts, 75, 10))
+>P : Symbol(P, Decl(instantiateContextualTypes.ts, 76, 5))
+>R : Symbol(R, Decl(instantiateContextualTypes.ts, 66, 1))
+>x : Symbol(x, Decl(instantiateContextualTypes.ts, 76, 24))
+>P : Symbol(P, Decl(instantiateContextualTypes.ts, 76, 5))
+>callback : Symbol(callback, Decl(instantiateContextualTypes.ts, 76, 29))
+>R : Symbol(R, Decl(instantiateContextualTypes.ts, 66, 1))
+>P : Symbol(P, Decl(instantiateContextualTypes.ts, 76, 5))
+
+};
+
+declare var x: O;
+>x : Symbol(x, Decl(instantiateContextualTypes.ts, 79, 11))
+>O : Symbol(O, Decl(instantiateContextualTypes.ts, 73, 2))
+
+x.on('a', a => {});
+>x.on : Symbol(on, Decl(instantiateContextualTypes.ts, 75, 10))
+>x : Symbol(x, Decl(instantiateContextualTypes.ts, 79, 11))
+>on : Symbol(on, Decl(instantiateContextualTypes.ts, 75, 10))
+>a : Symbol(a, Decl(instantiateContextualTypes.ts, 80, 9))
+
+// #29775
+
+namespace N1 {
+>N1 : Symbol(N1, Decl(instantiateContextualTypes.ts, 80, 19))
+
+declare class Component {
+>Component : Symbol(Component, Decl(instantiateContextualTypes.ts, 84, 14))
+>P : Symbol(P, Decl(instantiateContextualTypes.ts, 86, 24))
+
+ constructor(props: P);
+>props : Symbol(props, Decl(instantiateContextualTypes.ts, 87, 14))
+>P : Symbol(P, Decl(instantiateContextualTypes.ts, 86, 24))
+}
+
+interface ComponentClass {
+>ComponentClass : Symbol(ComponentClass, Decl(instantiateContextualTypes.ts, 88, 1))
+>P : Symbol(P, Decl(instantiateContextualTypes.ts, 90, 25))
+
+ new (props: P): Component ;
+>props : Symbol(props, Decl(instantiateContextualTypes.ts, 91, 7))
+>P : Symbol(P, Decl(instantiateContextualTypes.ts, 90, 25))
+>Component : Symbol(Component, Decl(instantiateContextualTypes.ts, 84, 14))
+>P : Symbol(P, Decl(instantiateContextualTypes.ts, 90, 25))
+}
+
+type CreateElementChildren =
+>CreateElementChildren : Symbol(CreateElementChildren, Decl(instantiateContextualTypes.ts, 92, 1))
+>P : Symbol(P, Decl(instantiateContextualTypes.ts, 94, 27))
+
+ P extends { children?: infer C }
+>P : Symbol(P, Decl(instantiateContextualTypes.ts, 94, 27))
+>children : Symbol(children, Decl(instantiateContextualTypes.ts, 95, 13))
+>C : Symbol(C, Decl(instantiateContextualTypes.ts, 95, 30))
+
+ ? C extends any[]
+>C : Symbol(C, Decl(instantiateContextualTypes.ts, 95, 30))
+
+ ? C
+>C : Symbol(C, Decl(instantiateContextualTypes.ts, 95, 30))
+
+ : C[]
+>C : Symbol(C, Decl(instantiateContextualTypes.ts, 95, 30))
+
+ : unknown;
+
+declare function createElement (
+>createElement : Symbol(createElement, Decl(instantiateContextualTypes.ts, 99, 12))
+>P : Symbol(P, Decl(instantiateContextualTypes.ts, 101, 31))
+
+ type: ComponentClass ,
+>type : Symbol(type, Decl(instantiateContextualTypes.ts, 101, 45))
+>ComponentClass : Symbol(ComponentClass, Decl(instantiateContextualTypes.ts, 88, 1))
+>P : Symbol(P, Decl(instantiateContextualTypes.ts, 101, 31))
+
+ ...children: CreateElementChildren
+>children : Symbol(children, Decl(instantiateContextualTypes.ts, 102, 26))
+>CreateElementChildren : Symbol(CreateElementChildren, Decl(instantiateContextualTypes.ts, 92, 1))
+>P : Symbol(P, Decl(instantiateContextualTypes.ts, 101, 31))
+
+): any;
+
+declare function createElement2 (
+>createElement2 : Symbol(createElement2, Decl(instantiateContextualTypes.ts, 104, 7))
+>P : Symbol(P, Decl(instantiateContextualTypes.ts, 106, 32))
+
+ type: ComponentClass ,
+>type : Symbol(type, Decl(instantiateContextualTypes.ts, 106, 46))
+>ComponentClass : Symbol(ComponentClass, Decl(instantiateContextualTypes.ts, 88, 1))
+>P : Symbol(P, Decl(instantiateContextualTypes.ts, 106, 32))
+
+ child: CreateElementChildren
+>child : Symbol(child, Decl(instantiateContextualTypes.ts, 107, 26))
+>CreateElementChildren : Symbol(CreateElementChildren, Decl(instantiateContextualTypes.ts, 92, 1))
+>P : Symbol(P, Decl(instantiateContextualTypes.ts, 106, 32))
+
+): any;
+
+class InferFunctionTypes extends Component<{children: (foo: number) => string}> {}
+>InferFunctionTypes : Symbol(InferFunctionTypes, Decl(instantiateContextualTypes.ts, 109, 7))
+>Component : Symbol(Component, Decl(instantiateContextualTypes.ts, 84, 14))
+>children : Symbol(children, Decl(instantiateContextualTypes.ts, 111, 44))
+>foo : Symbol(foo, Decl(instantiateContextualTypes.ts, 111, 55))
+
+createElement(InferFunctionTypes, (foo) => "" + foo);
+>createElement : Symbol(createElement, Decl(instantiateContextualTypes.ts, 99, 12))
+>InferFunctionTypes : Symbol(InferFunctionTypes, Decl(instantiateContextualTypes.ts, 109, 7))
+>foo : Symbol(foo, Decl(instantiateContextualTypes.ts, 113, 35))
+>foo : Symbol(foo, Decl(instantiateContextualTypes.ts, 113, 35))
+
+createElement2(InferFunctionTypes, [(foo) => "" + foo]);
+>createElement2 : Symbol(createElement2, Decl(instantiateContextualTypes.ts, 104, 7))
+>InferFunctionTypes : Symbol(InferFunctionTypes, Decl(instantiateContextualTypes.ts, 109, 7))
+>foo : Symbol(foo, Decl(instantiateContextualTypes.ts, 115, 37))
+>foo : Symbol(foo, Decl(instantiateContextualTypes.ts, 115, 37))
+
+}
+
+// #30341
+
+type InnerBox { constructor(props: P); props: P; }
+>Component : Component
+>props : P
+>props : P
+
+declare class GenericComponent = string & { attachPayloadTypeHack?: P & never }
+>ActionType : ActionType
+>attachPayloadTypeHack : undefined
+
+type Handler
+>actionType : ActionType
+
+ handler: Handler , handler: Handler , handler: Handler
+>handler : Handler , handler: Handler , handler: Handler (x: P, callback: R[P]): void;
+>on : (x: P, callback: R[P]) => void
+>x : P
+>callback : R[P]
+
+};
+
+declare var x: O;
+>x : O
+
+x.on('a', a => {});
+>x.on('a', a => {}) : void
+>x.on : (x: P, callback: R[P]) => void
+>x : O
+>on : (x: P, callback: R[P]) => void
+>'a' : "a"
+>a => {} : (a: number) => void
+>a : number
+
+// #29775
+
+namespace N1 {
+>N1 : typeof N1
+
+declare class Component {
+>Component : Component
+
+ constructor(props: P);
+>props : P
+}
+
+interface ComponentClass {
+ new (props: P): Component ;
+>props : P
+}
+
+type CreateElementChildren =
+>CreateElementChildren : P extends { children?: infer C | undefined; } ? C extends any[] ? C : C[] : unknown
+
+ P extends { children?: infer C }
+>children : C | undefined
+
+ ? C extends any[]
+ ? C
+ : C[]
+ : unknown;
+
+declare function createElement (
+>createElement : (type: ComponentClass , ...children: P extends { children?: infer C | undefined; } ? C extends any[] ? C : C[] : unknown) => any
+
+ type: ComponentClass ,
+>type : ComponentClass
+
+ ...children: CreateElementChildren
+>children : P extends { children?: infer C | undefined; } ? C extends any[] ? C : C[] : unknown
+
+): any;
+
+declare function createElement2 (
+>createElement2 : (type: ComponentClass , child: P extends { children?: infer C | undefined; } ? C extends any[] ? C : C[] : unknown) => any
+
+ type: ComponentClass ,
+>type : ComponentClass
+
+ child: CreateElementChildren
+>child : P extends { children?: infer C | undefined; } ? C extends any[] ? C : C[] : unknown
+
+): any;
+
+class InferFunctionTypes extends Component<{children: (foo: number) => string}> {}
+>InferFunctionTypes : InferFunctionTypes
+>Component : Component<{ children: (foo: number) => string; }>
+>children : (foo: number) => string
+>foo : number
+
+createElement(InferFunctionTypes, (foo) => "" + foo);
+>createElement(InferFunctionTypes, (foo) => "" + foo) : any
+>createElement : (type: ComponentClass , ...children: P extends { children?: infer C | undefined; } ? C extends any[] ? C : C[] : unknown) => any
+>InferFunctionTypes : typeof InferFunctionTypes
+>(foo) => "" + foo : (foo: number) => string
+>foo : number
+>"" + foo : string
+>"" : ""
+>foo : number
+
+createElement2(InferFunctionTypes, [(foo) => "" + foo]);
+>createElement2(InferFunctionTypes, [(foo) => "" + foo]) : any
+>createElement2 : (type: ComponentClass , child: P extends { children?: infer C | undefined; } ? C extends any[] ? C : C[] : unknown) => any
+>InferFunctionTypes : typeof InferFunctionTypes
+>[(foo) => "" + foo] : ((foo: number) => string)[]
+>(foo) => "" + foo : (foo: number) => string
+>foo : number
+>"" + foo : string
+>"" : ""
+>foo : number
+
+}
+
+// #30341
+
+type InnerBox = P extends void
+ ? (state: S) => S
+ : (state: S, payload: P) => S
+
+interface ActionHandler {
+ actionType: ActionType
+}
+
+declare function handler(actionType: ActionType): ActionHandler
+
+declare function createReducer(
+ defaultState: S,
+ ...actionHandlers: ActionHandler[]
+ ): any
+
+interface AppState {
+ dummy: string
+}
+
+const defaultState: AppState = {
+ dummy: ''
+}
+
+const NON_VOID_ACTION: ActionType = P extends void
+>Handler : Symbol(Handler, Decl(instantiateContextualTypes.ts, 33, 67))
+>S : Symbol(S, Decl(instantiateContextualTypes.ts, 35, 13))
+>P : Symbol(P, Decl(instantiateContextualTypes.ts, 35, 15))
+>P : Symbol(P, Decl(instantiateContextualTypes.ts, 35, 15))
+
+ ? (state: S) => S
+>state : Symbol(state, Decl(instantiateContextualTypes.ts, 36, 7))
+>S : Symbol(S, Decl(instantiateContextualTypes.ts, 35, 13))
+>S : Symbol(S, Decl(instantiateContextualTypes.ts, 35, 13))
+
+ : (state: S, payload: P) => S
+>state : Symbol(state, Decl(instantiateContextualTypes.ts, 37, 7))
+>S : Symbol(S, Decl(instantiateContextualTypes.ts, 35, 13))
+>payload : Symbol(payload, Decl(instantiateContextualTypes.ts, 37, 16))
+>P : Symbol(P, Decl(instantiateContextualTypes.ts, 35, 15))
+>S : Symbol(S, Decl(instantiateContextualTypes.ts, 35, 13))
+
+interface ActionHandler {
+>ActionHandler : Symbol(ActionHandler, Decl(instantiateContextualTypes.ts, 37, 33))
+>S : Symbol(S, Decl(instantiateContextualTypes.ts, 39, 24))
+>P : Symbol(P, Decl(instantiateContextualTypes.ts, 39, 26))
+
+ actionType: ActionType
+>handler : Symbol(ActionHandler.handler, Decl(instantiateContextualTypes.ts, 40, 29))
+>Handler : Symbol(Handler, Decl(instantiateContextualTypes.ts, 33, 67))
+>S : Symbol(S, Decl(instantiateContextualTypes.ts, 39, 24))
+>P : Symbol(P, Decl(instantiateContextualTypes.ts, 39, 26))
+}
+
+declare function handler(actionType: ActionType): ActionHandler
+>handler : Symbol(handler, Decl(instantiateContextualTypes.ts, 42, 1))
+>S : Symbol(S, Decl(instantiateContextualTypes.ts, 44, 25))
+>P : Symbol(P, Decl(instantiateContextualTypes.ts, 44, 27))
+>actionType : Symbol(actionType, Decl(instantiateContextualTypes.ts, 44, 31))
+>ActionType : Symbol(ActionType, Decl(instantiateContextualTypes.ts, 29, 33))
+>P : Symbol(P, Decl(instantiateContextualTypes.ts, 44, 27))
+>handler : Symbol(handler, Decl(instantiateContextualTypes.ts, 44, 57))
+>Handler : Symbol(Handler, Decl(instantiateContextualTypes.ts, 33, 67))
+>S : Symbol(S, Decl(instantiateContextualTypes.ts, 44, 25))
+>P : Symbol(P, Decl(instantiateContextualTypes.ts, 44, 27))
+>ActionHandler : Symbol(ActionHandler, Decl(instantiateContextualTypes.ts, 37, 33))
+>S : Symbol(S, Decl(instantiateContextualTypes.ts, 44, 25))
+>P : Symbol(P, Decl(instantiateContextualTypes.ts, 44, 27))
+
+declare function createReducer(
+>createReducer : Symbol(createReducer, Decl(instantiateContextualTypes.ts, 44, 102))
+>S : Symbol(S, Decl(instantiateContextualTypes.ts, 46, 31))
+
+ defaultState: S,
+>defaultState : Symbol(defaultState, Decl(instantiateContextualTypes.ts, 46, 34))
+>S : Symbol(S, Decl(instantiateContextualTypes.ts, 46, 31))
+
+ ...actionHandlers: ActionHandler[]
+>actionHandlers : Symbol(actionHandlers, Decl(instantiateContextualTypes.ts, 47, 24))
+>ActionHandler : Symbol(ActionHandler, Decl(instantiateContextualTypes.ts, 37, 33))
+>S : Symbol(S, Decl(instantiateContextualTypes.ts, 46, 31))
+
+ ): any
+
+interface AppState {
+>AppState : Symbol(AppState, Decl(instantiateContextualTypes.ts, 49, 10))
+
+ dummy: string
+>dummy : Symbol(AppState.dummy, Decl(instantiateContextualTypes.ts, 51, 20))
+}
+
+const defaultState: AppState = {
+>defaultState : Symbol(defaultState, Decl(instantiateContextualTypes.ts, 55, 5))
+>AppState : Symbol(AppState, Decl(instantiateContextualTypes.ts, 49, 10))
+
+ dummy: ''
+>dummy : Symbol(dummy, Decl(instantiateContextualTypes.ts, 55, 32))
+}
+
+const NON_VOID_ACTION: ActionType = P extends void
+>Handler : Handler
+
+ ? (state: S) => S
+>state : S
+
+ : (state: S, payload: P) => S
+>state : S
+>payload : P
+
+interface ActionHandler {
+ actionType: ActionType
+>handler : Handler
+}
+
+declare function handler(actionType: ActionType): ActionHandler
+>handler : (actionType: ActionType) => ActionHandler
+>actionType : ActionType
+
+declare function createReducer(
+>createReducer : (defaultState: S, ...actionHandlers: ActionHandler[]) => any
+
+ defaultState: S,
+>defaultState : S
+
+ ...actionHandlers: ActionHandler[]
+>actionHandlers : ActionHandler[]
+
+ ): any
+
+interface AppState {
+ dummy: string
+>dummy : string
+}
+
+const defaultState: AppState = {
+>defaultState : AppState
+>{ dummy: ''} : { dummy: string; }
+
+ dummy: ''
+>dummy : string
+>'' : ""
+}
+
+const NON_VOID_ACTION: ActionType(defaultState: S, ...actionHandlers: ActionHandler[]) => any
+
+ defaultState,
+>defaultState : AppState
+
+ handler(NON_VOID_ACTION, (state, _payload) => state),
+>handler(NON_VOID_ACTION, (state, _payload) => state) : ActionHandler(actionType: ActionType) => ActionHandler
+>NON_VOID_ACTION : ActionType(actionType: ActionType) => ActionHandler
+>VOID_ACTION : ActionType