optionalParamTypeComparison.ts(4,1): error TS2322: Type '(s: string, b?: boolean | undefined) => void' is not assignable to type '(s: string, n?: number | undefined) => void'.
  Types of parameters 'b' and 'n' are incompatible.
    Type 'number | undefined' is not assignable to type 'boolean | undefined'.
      Type 'number' is not assignable to type 'boolean | undefined'.
optionalParamTypeComparison.ts(5,1): error TS2322: Type '(s: string, n?: number | undefined) => void' is not assignable to type '(s: string, b?: boolean | undefined) => void'.
  Types of parameters 'n' and 'b' are incompatible.
    Type 'boolean | undefined' is not assignable to type 'number | undefined'.
      Type 'boolean' is not assignable to type 'number'.


==== optionalParamTypeComparison.ts (2 errors) ====
    declare var f: (s: string, n?: number) => void;
    declare var g: (s: string, b?: boolean) => void;
    
    f = g;
    ~
!!! error TS2322: Type '(s: string, b?: boolean | undefined) => void' is not assignable to type '(s: string, n?: number | undefined) => void'.
!!! error TS2322:   Types of parameters 'b' and 'n' are incompatible.
!!! error TS2322:     Type 'number | undefined' is not assignable to type 'boolean | undefined'.
!!! error TS2322:       Type 'number' is not assignable to type 'boolean | undefined'.
    g = f;
    ~
!!! error TS2322: Type '(s: string, n?: number | undefined) => void' is not assignable to type '(s: string, b?: boolean | undefined) => void'.
!!! error TS2322:   Types of parameters 'n' and 'b' are incompatible.
!!! error TS2322:     Type 'boolean | undefined' is not assignable to type 'number | undefined'.
!!! error TS2322:       Type 'boolean' is not assignable to type 'number'.