generatorTypeCheck62.ts(24,62): error TS2345: Argument of type '(state: State) => Generator<never, State, any>' is not assignable to parameter of type '(a: State) => IterableIterator<State, void>'.
  Call signature return types 'Generator<never, State, any>' and 'IterableIterator<State, void>' are incompatible.
    The types returned by 'next(...)' are incompatible between these types.
      Type 'IteratorResult<never, State>' is not assignable to type 'IteratorResult<State, void>'.
        Type 'IteratorReturnResult<State>' is not assignable to type 'IteratorResult<State, void>'.
          Type 'IteratorReturnResult<State>' is not assignable to type 'IteratorReturnResult<void>'.
            Type 'State' is not assignable to type 'void'.
generatorTypeCheck62.ts(32,62): error TS2345: Argument of type '(state: State) => Generator<any, State, any>' is not assignable to parameter of type '(a: any) => IterableIterator<any, void>'.
  Call signature return types 'Generator<any, State, any>' and 'IterableIterator<any, void>' are incompatible.
    The types returned by 'next(...)' are incompatible between these types.
      Type 'IteratorResult<any, State>' is not assignable to type 'IteratorResult<any, void>'.
        Type 'IteratorReturnResult<State>' is not assignable to type 'IteratorResult<any, void>'.
          Type 'IteratorReturnResult<State>' is not assignable to type 'IteratorReturnResult<void>'.
            Type 'State' is not assignable to type 'void'.
generatorTypeCheck62.ts(32,62): error TS7025: Generator implicitly has yield type 'any'. Consider supplying a return type annotation.


==== generatorTypeCheck62.ts (3 errors) ====
    export interface StrategicState {
        lastStrategyApplied?: string;
    }
    
    export function strategy<T extends StrategicState>(stratName: string, gen: (a: T) => IterableIterator<T | undefined, void>): (a: T) => IterableIterator<T | undefined, void> {
        return function*(state) {
            for (const next of gen(state)) {
                if (next) {
                    next.lastStrategyApplied = stratName;
                }
                yield next;
            }
        }
    }
    
    export interface Strategy<T> {
        (a: T): IterableIterator<T | undefined, void>;
    }
    
    export interface State extends StrategicState {
        foo: number;
    }
    
    export const Nothing1: Strategy<State> = strategy("Nothing", function*(state: State) {
                                                                 ~~~~~~~~
!!! error TS2345: Argument of type '(state: State) => Generator<never, State, any>' is not assignable to parameter of type '(a: State) => IterableIterator<State, void>'.
!!! error TS2345:   Call signature return types 'Generator<never, State, any>' and 'IterableIterator<State, void>' are incompatible.
!!! error TS2345:     The types returned by 'next(...)' are incompatible between these types.
!!! error TS2345:       Type 'IteratorResult<never, State>' is not assignable to type 'IteratorResult<State, void>'.
!!! error TS2345:         Type 'IteratorReturnResult<State>' is not assignable to type 'IteratorResult<State, void>'.
!!! error TS2345:           Type 'IteratorReturnResult<State>' is not assignable to type 'IteratorReturnResult<void>'.
!!! error TS2345:             Type 'State' is not assignable to type 'void'.
        return state; // `return`/`TReturn` isn't supported by `strategy`, so this should error.
    });
    
    export const Nothing2: Strategy<State> = strategy("Nothing", function*(state: State) {
        yield state;
    });
    
    export const Nothing3: Strategy<State> = strategy("Nothing", function* (state: State) {
                                                                 ~~~~~~~~
!!! error TS2345: Argument of type '(state: State) => Generator<any, State, any>' is not assignable to parameter of type '(a: any) => IterableIterator<any, void>'.
!!! error TS2345:   Call signature return types 'Generator<any, State, any>' and 'IterableIterator<any, void>' are incompatible.
!!! error TS2345:     The types returned by 'next(...)' are incompatible between these types.
!!! error TS2345:       Type 'IteratorResult<any, State>' is not assignable to type 'IteratorResult<any, void>'.
!!! error TS2345:         Type 'IteratorReturnResult<State>' is not assignable to type 'IteratorResult<any, void>'.
!!! error TS2345:           Type 'IteratorReturnResult<State>' is not assignable to type 'IteratorReturnResult<void>'.
!!! error TS2345:             Type 'State' is not assignable to type 'void'.
                                                                 ~~~~~~~~
!!! error TS7025: Generator implicitly has yield type 'any'. Consider supplying a return type annotation.
        yield ;
        return state; // `return`/`TReturn` isn't supported by `strategy`, so this should error.
    });
     