generatorTypeCheck63.ts(24,61): error TS2345: Argument of type '(state: State) => Generator<number, State, any>' is not assignable to parameter of type '(a: State) => IterableIterator<State, void>'.
  Call signature return types 'Generator<number, State, any>' and 'IterableIterator<State, void>' are incompatible.
    The types returned by 'next(...)' are incompatible between these types.
      Type 'IteratorResult<number, State>' is not assignable to type 'IteratorResult<State, void>'.
        Type 'IteratorYieldResult<number>' is not assignable to type 'IteratorResult<State, void>'.
          Type 'IteratorYieldResult<number>' is not assignable to type 'IteratorYieldResult<State>'.
            Type 'number' is not assignable to type 'State'.
generatorTypeCheck63.ts(32,62): error TS2345: Argument of type '(state: State) => Generator<never, number, any>' is not assignable to parameter of type '(a: State) => IterableIterator<State, void>'.
  Call signature return types 'Generator<never, number, any>' and 'IterableIterator<State, void>' are incompatible.
    The types returned by 'next(...)' are incompatible between these types.
      Type 'IteratorResult<never, number>' is not assignable to type 'IteratorResult<State, void>'.
        Type 'IteratorReturnResult<number>' is not assignable to type 'IteratorResult<State, void>'.
          Type 'IteratorReturnResult<number>' is not assignable to type 'IteratorReturnResult<void>'.
            Type 'number' is not assignable to type 'void'.
generatorTypeCheck63.ts(36,62): error TS2345: Argument of type '(state: State) => Generator<State, number, any>' is not assignable to parameter of type '(a: State) => IterableIterator<State, void>'.
  Call signature return types 'Generator<State, number, any>' and 'IterableIterator<State, void>' are incompatible.
    The types returned by 'next(...)' are incompatible between these types.
      Type 'IteratorResult<State, number>' is not assignable to type 'IteratorResult<State, void>'.
        Type 'IteratorReturnResult<number>' is not assignable to type 'IteratorResult<State, void>'.
          Type 'IteratorReturnResult<number>' is not assignable to type 'IteratorReturnResult<void>'.
            Type 'number' is not assignable to type 'void'.


==== generatorTypeCheck63.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 Nothing: Strategy<State> = strategy("Nothing", function* (state: State) {
                                                                ~~~~~~~~
!!! error TS2345: Argument of type '(state: State) => Generator<number, State, any>' is not assignable to parameter of type '(a: State) => IterableIterator<State, void>'.
!!! error TS2345:   Call signature return types 'Generator<number, State, any>' and 'IterableIterator<State, void>' are incompatible.
!!! error TS2345:     The types returned by 'next(...)' are incompatible between these types.
!!! error TS2345:       Type 'IteratorResult<number, State>' is not assignable to type 'IteratorResult<State, void>'.
!!! error TS2345:         Type 'IteratorYieldResult<number>' is not assignable to type 'IteratorResult<State, void>'.
!!! error TS2345:           Type 'IteratorYieldResult<number>' is not assignable to type 'IteratorYieldResult<State>'.
!!! error TS2345:             Type 'number' is not assignable to type 'State'.
        yield 1; // number isn't a `State`, so this should error.
        return state; // `return`/`TReturn` isn't supported by `strategy`, so this should error.
    });
    
    export const Nothing1: Strategy<State> = strategy("Nothing", function* (state: State) {
    });
    
    export const Nothing2: Strategy<State> = strategy("Nothing", function* (state: State) {
                                                                 ~~~~~~~~
!!! error TS2345: Argument of type '(state: State) => Generator<never, number, any>' is not assignable to parameter of type '(a: State) => IterableIterator<State, void>'.
!!! error TS2345:   Call signature return types 'Generator<never, number, any>' and 'IterableIterator<State, void>' are incompatible.
!!! error TS2345:     The types returned by 'next(...)' are incompatible between these types.
!!! error TS2345:       Type 'IteratorResult<never, number>' is not assignable to type 'IteratorResult<State, void>'.
!!! error TS2345:         Type 'IteratorReturnResult<number>' is not assignable to type 'IteratorResult<State, void>'.
!!! error TS2345:           Type 'IteratorReturnResult<number>' is not assignable to type 'IteratorReturnResult<void>'.
!!! error TS2345:             Type 'number' is not assignable to type 'void'.
        return 1; // `return`/`TReturn` isn't supported by `strategy`, so this should error.
    });
    
    export const Nothing3: Strategy<State> = strategy("Nothing", function* (state: State) {
                                                                 ~~~~~~~~
!!! error TS2345: Argument of type '(state: State) => Generator<State, number, any>' is not assignable to parameter of type '(a: State) => IterableIterator<State, void>'.
!!! error TS2345:   Call signature return types 'Generator<State, number, any>' and 'IterableIterator<State, void>' are incompatible.
!!! error TS2345:     The types returned by 'next(...)' are incompatible between these types.
!!! error TS2345:       Type 'IteratorResult<State, number>' is not assignable to type 'IteratorResult<State, void>'.
!!! error TS2345:         Type 'IteratorReturnResult<number>' is not assignable to type 'IteratorResult<State, void>'.
!!! error TS2345:           Type 'IteratorReturnResult<number>' is not assignable to type 'IteratorReturnResult<void>'.
!!! error TS2345:             Type 'number' is not assignable to type 'void'.
        yield state;
        return 1; // `return`/`TReturn` isn't supported by `strategy`, so this should error.
    });