optionalFunctionArgAssignability.ts(5,105): error TS2322: Type 'null' is not assignable to type 'Promise<U>'.
optionalFunctionArgAssignability.ts(6,105): error TS2322: Type 'null' is not assignable to type 'Promise<U>'.
optionalFunctionArgAssignability.ts(7,1): error TS2322: Type '<U>(onFulFill?: (value: number) => U, onReject?: (reason: any) => U) => Promise<U>' is not assignable to type '<U>(onFulfill?: (value: string) => U, onReject?: (reason: any) => U) => Promise<U>'.
  Types of parameters 'onFulFill' and 'onFulfill' are incompatible.
    Types of parameters 'value' and 'value' are incompatible.
      Type 'number' is not assignable to type 'string'.


==== optionalFunctionArgAssignability.ts (3 errors) ====
    interface Promise<T> {
        then<U>(onFulfill?: (value: T) => U, onReject?: (reason: any) => U): Promise<U>;
    }
     
    var a = function then<U>(onFulfill?: (value: string) => U, onReject?: (reason: any) => U): Promise<U> { return null };
                                                                                                            ~~~~~~
!!! error TS2322: Type 'null' is not assignable to type 'Promise<U>'.
    var b = function then<U>(onFulFill?: (value: number) => U, onReject?: (reason: any) => U): Promise<U> { return null };
                                                                                                            ~~~~~~
!!! error TS2322: Type 'null' is not assignable to type 'Promise<U>'.
    a = b; // error because number is not assignable to string
    ~
!!! error TS2322: Type '<U>(onFulFill?: (value: number) => U, onReject?: (reason: any) => U) => Promise<U>' is not assignable to type '<U>(onFulfill?: (value: string) => U, onReject?: (reason: any) => U) => Promise<U>'.
!!! error TS2322:   Types of parameters 'onFulFill' and 'onFulfill' are incompatible.
!!! error TS2322:     Types of parameters 'value' and 'value' are incompatible.
!!! error TS2322:       Type 'number' is not assignable to type 'string'.
    