hunk.code_window:   const p = of(1, 2, 3).pipe(multicast(new Subject<number>(), p => of('foo'))); // $ExpectType Observable<string>
     const q = of(1, 2, 3).pipe(multicast(() => new Subject<number>(), p => p)); // $ExpectType Observable<number>
     const r = of(1, 2, 3).pipe(multicast(() => new Subject<number>(), p => of('foo'))); // $ExpectType Observable<string>
   });
   it('should enforce types', () => {
     const p = of(1, 2, 3).pipe(multicast()); // $ExpectError
   });
  
hunk.labels: keep keep keep keep add keep keep keep
hunk.after_edit: it('should support union types', () => {
     const o = of(1, 2, 3).pipe(multicast(new Subject<number>(), p => Math.random() > 0.5 ? of(123) : of('foo'))); // $ExpectType Observable<string | number>
     const p = of(1, 2, 3).pipe(multicast(() => new Subject<number>(), p => Math.random() > 0.5 ? of(123) : of('foo'))); // $ExpectType Observable<string | number>
   });
  
hunk.file_path: spec-dtslint/operators/multicast-spec.ts
hunk.type: add
file: import { Observable } from '../Observable';
  import { ReplaySubject } from '../ReplaySubject';
  import { multicast } from './multicast';
  import { ConnectableObservable } from '../observable/ConnectableObservable';
  import { UnaryFunction, MonoTypeOperatorFunction, OperatorFunction, SchedulerLike } from '../types';
  
  /* tslint:disable:max-line-length */
  export function publishReplay<T>(bufferSize?: number, windowTime?: number, scheduler?: SchedulerLike): MonoTypeOperatorFunction<T>;
  export function publishReplay<T, R>(bufferSize?: number, windowTime?: number, selector?: OperatorFunction<T, R>, scheduler?: SchedulerLike): OperatorFunction<T, R>;
  export function publishReplay<T>(bufferSize?: number, windowTime?: number, selector?: MonoTypeOperatorFunction<T>, scheduler?: SchedulerLike): MonoTypeOperatorFunction<T>;
  /* tslint:enable:max-line-length */
  
  export function publishReplay<T, R>(bufferSize?: number,
                                      windowTime?: number,
                                      selectorOrScheduler?: SchedulerLike | OperatorFunction<T, R>,
                                      scheduler?: SchedulerLike): UnaryFunction<Observable<T>, ConnectableObservable<R>> {
  
    if (selectorOrScheduler && typeof selectorOrScheduler !== 'function') {
      scheduler = selectorOrScheduler;
    }
  
    const selector = typeof selectorOrScheduler === 'function' ? selectorOrScheduler : undefined;
    const subject = new ReplaySubject<T>(bufferSize, windowTime, scheduler);
  
    return (source: Observable<T>) => multicast(() => subject, selector)(source) as ConnectableObservable<R>;
  }
  