arrayBestCommonTypes.ts(16,37): error TS2769: No overload matches this call.
  Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | undefined' is not assignable to parameter of type 'boolean'.
      Type 'undefined' is not assignable to type 'boolean'.
  Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | undefined' is not assignable to parameter of type 'string'.
      Type 'undefined' is not assignable to type 'string'.
  Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | undefined' is not assignable to parameter of type 'number'.
      Type 'undefined' is not assignable to type 'number'.
arrayBestCommonTypes.ts(17,37): error TS2769: No overload matches this call.
  Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | undefined' is not assignable to parameter of type 'boolean'.
      Type 'undefined' is not assignable to type 'boolean'.
  Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | undefined' is not assignable to parameter of type 'string'.
      Type 'undefined' is not assignable to type 'string'.
  Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | undefined' is not assignable to parameter of type 'number'.
      Type 'undefined' is not assignable to type 'number'.
arrayBestCommonTypes.ts(18,37): error TS2769: No overload matches this call.
  Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | null' is not assignable to parameter of type 'boolean'.
      Type 'null' is not assignable to type 'boolean'.
  Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | null' is not assignable to parameter of type 'string'.
      Type 'null' is not assignable to type 'string'.
  Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | null' is not assignable to parameter of type 'number'.
      Type 'null' is not assignable to type 'number'.
arrayBestCommonTypes.ts(19,37): error TS2769: No overload matches this call.
  Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | null' is not assignable to parameter of type 'boolean'.
      Type 'null' is not assignable to type 'boolean'.
  Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | null' is not assignable to parameter of type 'string'.
      Type 'null' is not assignable to type 'string'.
  Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | null' is not assignable to parameter of type 'number'.
      Type 'null' is not assignable to type 'number'.
arrayBestCommonTypes.ts(20,37): error TS2769: No overload matches this call.
  Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | null | undefined' is not assignable to parameter of type 'boolean'.
      Type 'undefined' is not assignable to type 'boolean'.
  Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | null | undefined' is not assignable to parameter of type 'string'.
      Type 'undefined' is not assignable to type 'string'.
  Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | null | undefined' is not assignable to parameter of type 'number'.
      Type 'undefined' is not assignable to type 'number'.
arrayBestCommonTypes.ts(23,37): error TS2769: No overload matches this call.
  Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
    Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'.
      Type 'undefined' is not assignable to type 'boolean'.
  Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
    Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
      Type 'undefined' is not assignable to type 'string'.
  Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
    Argument of type 'string | undefined' is not assignable to parameter of type 'number'.
      Type 'undefined' is not assignable to type 'number'.
arrayBestCommonTypes.ts(24,37): error TS2769: No overload matches this call.
  Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
    Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'.
      Type 'undefined' is not assignable to type 'boolean'.
  Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
    Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
      Type 'undefined' is not assignable to type 'string'.
  Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
    Argument of type 'string | undefined' is not assignable to parameter of type 'number'.
      Type 'undefined' is not assignable to type 'number'.
arrayBestCommonTypes.ts(25,37): error TS2769: No overload matches this call.
  Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
    Argument of type 'string | null' is not assignable to parameter of type 'boolean'.
      Type 'null' is not assignable to type 'boolean'.
  Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
    Argument of type 'string | null' is not assignable to parameter of type 'string'.
      Type 'null' is not assignable to type 'string'.
  Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
    Argument of type 'string | null' is not assignable to parameter of type 'number'.
      Type 'null' is not assignable to type 'number'.
arrayBestCommonTypes.ts(26,37): error TS2769: No overload matches this call.
  Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
    Argument of type 'string | null' is not assignable to parameter of type 'boolean'.
      Type 'null' is not assignable to type 'boolean'.
  Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
    Argument of type 'string | null' is not assignable to parameter of type 'string'.
      Type 'null' is not assignable to type 'string'.
  Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
    Argument of type 'string | null' is not assignable to parameter of type 'number'.
      Type 'null' is not assignable to type 'number'.
arrayBestCommonTypes.ts(27,37): error TS2769: No overload matches this call.
  Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
    Argument of type 'string | null | undefined' is not assignable to parameter of type 'boolean'.
      Type 'undefined' is not assignable to type 'boolean'.
  Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
    Argument of type 'string | null | undefined' is not assignable to parameter of type 'string'.
      Type 'undefined' is not assignable to type 'string'.
  Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
    Argument of type 'string | null | undefined' is not assignable to parameter of type 'number'.
      Type 'undefined' is not assignable to type 'number'.
arrayBestCommonTypes.ts(29,37): error TS2769: No overload matches this call.
  Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | null' is not assignable to parameter of type 'boolean'.
      Type 'null' is not assignable to type 'boolean'.
  Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | null' is not assignable to parameter of type 'string'.
      Type 'null' is not assignable to type 'string'.
  Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | null' is not assignable to parameter of type 'number'.
      Type 'null' is not assignable to type 'number'.
arrayBestCommonTypes.ts(34,52): error TS2322: Type 'undefined' is not assignable to type 'string'.
arrayBestCommonTypes.ts(42,17): error TS2322: Type 'null' is not assignable to type 'iface'.
arrayBestCommonTypes.ts(56,35): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor.
arrayBestCommonTypes.ts(56,46): error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor.
arrayBestCommonTypes.ts(57,36): error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor.
arrayBestCommonTypes.ts(57,47): error TS2564: Property 'z' has no initializer and is not definitely assigned in the constructor.
arrayBestCommonTypes.ts(58,34): error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor.
arrayBestCommonTypes.ts(69,37): error TS2769: No overload matches this call.
  Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | undefined' is not assignable to parameter of type 'boolean'.
      Type 'undefined' is not assignable to type 'boolean'.
  Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | undefined' is not assignable to parameter of type 'string'.
      Type 'undefined' is not assignable to type 'string'.
  Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | undefined' is not assignable to parameter of type 'number'.
      Type 'undefined' is not assignable to type 'number'.
arrayBestCommonTypes.ts(70,37): error TS2769: No overload matches this call.
  Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | undefined' is not assignable to parameter of type 'boolean'.
      Type 'undefined' is not assignable to type 'boolean'.
  Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | undefined' is not assignable to parameter of type 'string'.
      Type 'undefined' is not assignable to type 'string'.
  Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | undefined' is not assignable to parameter of type 'number'.
      Type 'undefined' is not assignable to type 'number'.
arrayBestCommonTypes.ts(71,37): error TS2769: No overload matches this call.
  Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | null' is not assignable to parameter of type 'boolean'.
      Type 'null' is not assignable to type 'boolean'.
  Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | null' is not assignable to parameter of type 'string'.
      Type 'null' is not assignable to type 'string'.
  Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | null' is not assignable to parameter of type 'number'.
      Type 'null' is not assignable to type 'number'.
arrayBestCommonTypes.ts(72,37): error TS2769: No overload matches this call.
  Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | null' is not assignable to parameter of type 'boolean'.
      Type 'null' is not assignable to type 'boolean'.
  Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | null' is not assignable to parameter of type 'string'.
      Type 'null' is not assignable to type 'string'.
  Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | null' is not assignable to parameter of type 'number'.
      Type 'null' is not assignable to type 'number'.
arrayBestCommonTypes.ts(73,37): error TS2769: No overload matches this call.
  Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | null | undefined' is not assignable to parameter of type 'boolean'.
      Type 'undefined' is not assignable to type 'boolean'.
  Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | null | undefined' is not assignable to parameter of type 'string'.
      Type 'undefined' is not assignable to type 'string'.
  Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | null | undefined' is not assignable to parameter of type 'number'.
      Type 'undefined' is not assignable to type 'number'.
arrayBestCommonTypes.ts(76,37): error TS2769: No overload matches this call.
  Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
    Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'.
      Type 'undefined' is not assignable to type 'boolean'.
  Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
    Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
      Type 'undefined' is not assignable to type 'string'.
  Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
    Argument of type 'string | undefined' is not assignable to parameter of type 'number'.
      Type 'undefined' is not assignable to type 'number'.
arrayBestCommonTypes.ts(77,37): error TS2769: No overload matches this call.
  Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
    Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'.
      Type 'undefined' is not assignable to type 'boolean'.
  Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
    Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
      Type 'undefined' is not assignable to type 'string'.
  Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
    Argument of type 'string | undefined' is not assignable to parameter of type 'number'.
      Type 'undefined' is not assignable to type 'number'.
arrayBestCommonTypes.ts(78,37): error TS2769: No overload matches this call.
  Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
    Argument of type 'string | null' is not assignable to parameter of type 'boolean'.
      Type 'null' is not assignable to type 'boolean'.
  Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
    Argument of type 'string | null' is not assignable to parameter of type 'string'.
      Type 'null' is not assignable to type 'string'.
  Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
    Argument of type 'string | null' is not assignable to parameter of type 'number'.
      Type 'null' is not assignable to type 'number'.
arrayBestCommonTypes.ts(79,37): error TS2769: No overload matches this call.
  Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
    Argument of type 'string | null' is not assignable to parameter of type 'boolean'.
      Type 'null' is not assignable to type 'boolean'.
  Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
    Argument of type 'string | null' is not assignable to parameter of type 'string'.
      Type 'null' is not assignable to type 'string'.
  Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
    Argument of type 'string | null' is not assignable to parameter of type 'number'.
      Type 'null' is not assignable to type 'number'.
arrayBestCommonTypes.ts(80,37): error TS2769: No overload matches this call.
  Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
    Argument of type 'string | null | undefined' is not assignable to parameter of type 'boolean'.
      Type 'undefined' is not assignable to type 'boolean'.
  Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
    Argument of type 'string | null | undefined' is not assignable to parameter of type 'string'.
      Type 'undefined' is not assignable to type 'string'.
  Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
    Argument of type 'string | null | undefined' is not assignable to parameter of type 'number'.
      Type 'undefined' is not assignable to type 'number'.
arrayBestCommonTypes.ts(82,37): error TS2769: No overload matches this call.
  Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | null' is not assignable to parameter of type 'boolean'.
      Type 'null' is not assignable to type 'boolean'.
  Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | null' is not assignable to parameter of type 'string'.
      Type 'null' is not assignable to type 'string'.
  Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
    Argument of type 'number | null' is not assignable to parameter of type 'number'.
      Type 'null' is not assignable to type 'number'.
arrayBestCommonTypes.ts(87,52): error TS2322: Type 'undefined' is not assignable to type 'string'.
arrayBestCommonTypes.ts(95,17): error TS2322: Type 'null' is not assignable to type 'iface'.


==== arrayBestCommonTypes.ts (31 errors) ====
    namespace EmptyTypes {
        interface iface { }
        class base implements iface { }
        class base2 implements iface { }
        class derived extends base { }
    
    
        class f {
            public voidIfAny(x: boolean, y?: boolean): number;
            public voidIfAny(x: string, y?: boolean): number;
            public voidIfAny(x: number, y?: boolean): number;
            public voidIfAny(x: any, y = false): any { return null; }
    
            public x() {
                <number>(this.voidIfAny([4, 2][0]));
                <number>(this.voidIfAny([4, 2, undefined][0]));
                                        ~~~~~~~~~~~~~~~~~~~~
!!! error TS2769: No overload matches this call.
!!! error TS2769:   Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | undefined' is not assignable to parameter of type 'boolean'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'boolean'.
!!! error TS2769:   Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | undefined' is not assignable to parameter of type 'string'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'string'.
!!! error TS2769:   Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | undefined' is not assignable to parameter of type 'number'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'number'.
!!! related TS2793 arrayBestCommonTypes.ts:12:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
                <number>(this.voidIfAny([undefined, 2, 4][0]));
                                        ~~~~~~~~~~~~~~~~~~~~
!!! error TS2769: No overload matches this call.
!!! error TS2769:   Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | undefined' is not assignable to parameter of type 'boolean'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'boolean'.
!!! error TS2769:   Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | undefined' is not assignable to parameter of type 'string'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'string'.
!!! error TS2769:   Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | undefined' is not assignable to parameter of type 'number'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'number'.
!!! related TS2793 arrayBestCommonTypes.ts:12:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
                <number>(this.voidIfAny([null, 2, 4][0]));
                                        ~~~~~~~~~~~~~~~
!!! error TS2769: No overload matches this call.
!!! error TS2769:   Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | null' is not assignable to parameter of type 'boolean'.
!!! error TS2769:       Type 'null' is not assignable to type 'boolean'.
!!! error TS2769:   Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | null' is not assignable to parameter of type 'string'.
!!! error TS2769:       Type 'null' is not assignable to type 'string'.
!!! error TS2769:   Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | null' is not assignable to parameter of type 'number'.
!!! error TS2769:       Type 'null' is not assignable to type 'number'.
!!! related TS2793 arrayBestCommonTypes.ts:12:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
                <number>(this.voidIfAny([2, 4, null][0]));
                                        ~~~~~~~~~~~~~~~
!!! error TS2769: No overload matches this call.
!!! error TS2769:   Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | null' is not assignable to parameter of type 'boolean'.
!!! error TS2769:       Type 'null' is not assignable to type 'boolean'.
!!! error TS2769:   Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | null' is not assignable to parameter of type 'string'.
!!! error TS2769:       Type 'null' is not assignable to type 'string'.
!!! error TS2769:   Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | null' is not assignable to parameter of type 'number'.
!!! error TS2769:       Type 'null' is not assignable to type 'number'.
!!! related TS2793 arrayBestCommonTypes.ts:12:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
                <number>(this.voidIfAny([undefined, 4, null][0]));
                                        ~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2769: No overload matches this call.
!!! error TS2769:   Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | null | undefined' is not assignable to parameter of type 'boolean'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'boolean'.
!!! error TS2769:   Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | null | undefined' is not assignable to parameter of type 'string'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'string'.
!!! error TS2769:   Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | null | undefined' is not assignable to parameter of type 'number'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'number'.
!!! related TS2793 arrayBestCommonTypes.ts:12:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
    
                <number>(this.voidIfAny(['', "q"][0]));
                <number>(this.voidIfAny(['', "q", undefined][0]));
                                        ~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2769: No overload matches this call.
!!! error TS2769:   Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'boolean'.
!!! error TS2769:   Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'string'.
!!! error TS2769:   Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'string | undefined' is not assignable to parameter of type 'number'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'number'.
!!! related TS2793 arrayBestCommonTypes.ts:12:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
                <number>(this.voidIfAny([undefined, "q", ''][0]));
                                        ~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2769: No overload matches this call.
!!! error TS2769:   Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'boolean'.
!!! error TS2769:   Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'string'.
!!! error TS2769:   Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'string | undefined' is not assignable to parameter of type 'number'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'number'.
!!! related TS2793 arrayBestCommonTypes.ts:12:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
                <number>(this.voidIfAny([null, "q", ''][0]));
                                        ~~~~~~~~~~~~~~~~~~
!!! error TS2769: No overload matches this call.
!!! error TS2769:   Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'string | null' is not assignable to parameter of type 'boolean'.
!!! error TS2769:       Type 'null' is not assignable to type 'boolean'.
!!! error TS2769:   Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'string | null' is not assignable to parameter of type 'string'.
!!! error TS2769:       Type 'null' is not assignable to type 'string'.
!!! error TS2769:   Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'string | null' is not assignable to parameter of type 'number'.
!!! error TS2769:       Type 'null' is not assignable to type 'number'.
!!! related TS2793 arrayBestCommonTypes.ts:12:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
                <number>(this.voidIfAny(["q", '', null][0]));
                                        ~~~~~~~~~~~~~~~~~~
!!! error TS2769: No overload matches this call.
!!! error TS2769:   Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'string | null' is not assignable to parameter of type 'boolean'.
!!! error TS2769:       Type 'null' is not assignable to type 'boolean'.
!!! error TS2769:   Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'string | null' is not assignable to parameter of type 'string'.
!!! error TS2769:       Type 'null' is not assignable to type 'string'.
!!! error TS2769:   Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'string | null' is not assignable to parameter of type 'number'.
!!! error TS2769:       Type 'null' is not assignable to type 'number'.
!!! related TS2793 arrayBestCommonTypes.ts:12:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
                <number>(this.voidIfAny([undefined, '', null][0]));
                                        ~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2769: No overload matches this call.
!!! error TS2769:   Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'string | null | undefined' is not assignable to parameter of type 'boolean'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'boolean'.
!!! error TS2769:   Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'string | null | undefined' is not assignable to parameter of type 'string'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'string'.
!!! error TS2769:   Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'string | null | undefined' is not assignable to parameter of type 'number'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'number'.
!!! related TS2793 arrayBestCommonTypes.ts:12:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
    
                <number>(this.voidIfAny([[3, 4], [null]][0][0]));
                                        ~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2769: No overload matches this call.
!!! error TS2769:   Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | null' is not assignable to parameter of type 'boolean'.
!!! error TS2769:       Type 'null' is not assignable to type 'boolean'.
!!! error TS2769:   Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | null' is not assignable to parameter of type 'string'.
!!! error TS2769:       Type 'null' is not assignable to type 'string'.
!!! error TS2769:   Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | null' is not assignable to parameter of type 'number'.
!!! error TS2769:       Type 'null' is not assignable to type 'number'.
!!! related TS2793 arrayBestCommonTypes.ts:12:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
    
    
                var t1: { x: number; y: base; }[] = [{ x: 7, y: new derived() }, { x: 5, y: new base() }];
                var t2: { x: boolean; y: base; }[] = [{ x: true, y: new derived() }, { x: false, y: new base() }];
                var t3: { x: string; y: base; }[] = [{ x: undefined, y: new base() }, { x: '', y: new derived() }];
                                                       ~
!!! error TS2322: Type 'undefined' is not assignable to type 'string'.
!!! related TS6500 arrayBestCommonTypes.ts:34:23: The expected type comes from property 'x' which is declared here on type '{ x: string; y: base; }'
    
                var anyObj: any = null;
                // Order matters here so test all the variants
                var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }];
                var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }];
                var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }];
    
                var ifaceObj: iface = null;
                    ~~~~~~~~
!!! error TS2322: Type 'null' is not assignable to type 'iface'.
                var baseObj = new base();
                var base2Obj = new base2();
    
                var b1 = [baseObj, base2Obj, ifaceObj];
                var b2 = [base2Obj, baseObj, ifaceObj];
                var b3 = [baseObj, ifaceObj, base2Obj];
                var b4 = [ifaceObj, baseObj, base2Obj];
            }
        }
    }
    
    namespace NonEmptyTypes {
        interface iface { x: string; }
        class base implements iface { x: string; y: string; }
                                      ~
!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor.
                                                 ~
!!! error TS2564: Property 'y' has no initializer and is not definitely assigned in the constructor.
        class base2 implements iface { x: string; z: string; }
                                       ~
!!! error TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor.
                                                  ~
!!! error TS2564: Property 'z' has no initializer and is not definitely assigned in the constructor.
        class derived extends base { a: string; }
                                     ~
!!! error TS2564: Property 'a' has no initializer and is not definitely assigned in the constructor.
    
    
        class f {
            public voidIfAny(x: boolean, y?: boolean): number;
            public voidIfAny(x: string, y?: boolean): number;
            public voidIfAny(x: number, y?: boolean): number;
            public voidIfAny(x: any, y = false): any { return null; }
    
            public x() {
                <number>(this.voidIfAny([4, 2][0]));
                <number>(this.voidIfAny([4, 2, undefined][0]));
                                        ~~~~~~~~~~~~~~~~~~~~
!!! error TS2769: No overload matches this call.
!!! error TS2769:   Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | undefined' is not assignable to parameter of type 'boolean'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'boolean'.
!!! error TS2769:   Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | undefined' is not assignable to parameter of type 'string'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'string'.
!!! error TS2769:   Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | undefined' is not assignable to parameter of type 'number'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'number'.
!!! related TS2793 arrayBestCommonTypes.ts:65:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
                <number>(this.voidIfAny([undefined, 2, 4][0]));
                                        ~~~~~~~~~~~~~~~~~~~~
!!! error TS2769: No overload matches this call.
!!! error TS2769:   Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | undefined' is not assignable to parameter of type 'boolean'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'boolean'.
!!! error TS2769:   Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | undefined' is not assignable to parameter of type 'string'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'string'.
!!! error TS2769:   Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | undefined' is not assignable to parameter of type 'number'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'number'.
!!! related TS2793 arrayBestCommonTypes.ts:65:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
                <number>(this.voidIfAny([null, 2, 4][0]));
                                        ~~~~~~~~~~~~~~~
!!! error TS2769: No overload matches this call.
!!! error TS2769:   Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | null' is not assignable to parameter of type 'boolean'.
!!! error TS2769:       Type 'null' is not assignable to type 'boolean'.
!!! error TS2769:   Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | null' is not assignable to parameter of type 'string'.
!!! error TS2769:       Type 'null' is not assignable to type 'string'.
!!! error TS2769:   Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | null' is not assignable to parameter of type 'number'.
!!! error TS2769:       Type 'null' is not assignable to type 'number'.
!!! related TS2793 arrayBestCommonTypes.ts:65:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
                <number>(this.voidIfAny([2, 4, null][0]));
                                        ~~~~~~~~~~~~~~~
!!! error TS2769: No overload matches this call.
!!! error TS2769:   Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | null' is not assignable to parameter of type 'boolean'.
!!! error TS2769:       Type 'null' is not assignable to type 'boolean'.
!!! error TS2769:   Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | null' is not assignable to parameter of type 'string'.
!!! error TS2769:       Type 'null' is not assignable to type 'string'.
!!! error TS2769:   Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | null' is not assignable to parameter of type 'number'.
!!! error TS2769:       Type 'null' is not assignable to type 'number'.
!!! related TS2793 arrayBestCommonTypes.ts:65:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
                <number>(this.voidIfAny([undefined, 4, null][0]));
                                        ~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2769: No overload matches this call.
!!! error TS2769:   Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | null | undefined' is not assignable to parameter of type 'boolean'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'boolean'.
!!! error TS2769:   Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | null | undefined' is not assignable to parameter of type 'string'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'string'.
!!! error TS2769:   Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | null | undefined' is not assignable to parameter of type 'number'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'number'.
!!! related TS2793 arrayBestCommonTypes.ts:65:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
    
                <number>(this.voidIfAny(['', "q"][0]));
                <number>(this.voidIfAny(['', "q", undefined][0]));
                                        ~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2769: No overload matches this call.
!!! error TS2769:   Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'boolean'.
!!! error TS2769:   Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'string'.
!!! error TS2769:   Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'string | undefined' is not assignable to parameter of type 'number'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'number'.
!!! related TS2793 arrayBestCommonTypes.ts:65:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
                <number>(this.voidIfAny([undefined, "q", ''][0]));
                                        ~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2769: No overload matches this call.
!!! error TS2769:   Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'string | undefined' is not assignable to parameter of type 'boolean'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'boolean'.
!!! error TS2769:   Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'string | undefined' is not assignable to parameter of type 'string'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'string'.
!!! error TS2769:   Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'string | undefined' is not assignable to parameter of type 'number'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'number'.
!!! related TS2793 arrayBestCommonTypes.ts:65:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
                <number>(this.voidIfAny([null, "q", ''][0]));
                                        ~~~~~~~~~~~~~~~~~~
!!! error TS2769: No overload matches this call.
!!! error TS2769:   Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'string | null' is not assignable to parameter of type 'boolean'.
!!! error TS2769:       Type 'null' is not assignable to type 'boolean'.
!!! error TS2769:   Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'string | null' is not assignable to parameter of type 'string'.
!!! error TS2769:       Type 'null' is not assignable to type 'string'.
!!! error TS2769:   Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'string | null' is not assignable to parameter of type 'number'.
!!! error TS2769:       Type 'null' is not assignable to type 'number'.
!!! related TS2793 arrayBestCommonTypes.ts:65:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
                <number>(this.voidIfAny(["q", '', null][0]));
                                        ~~~~~~~~~~~~~~~~~~
!!! error TS2769: No overload matches this call.
!!! error TS2769:   Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'string | null' is not assignable to parameter of type 'boolean'.
!!! error TS2769:       Type 'null' is not assignable to type 'boolean'.
!!! error TS2769:   Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'string | null' is not assignable to parameter of type 'string'.
!!! error TS2769:       Type 'null' is not assignable to type 'string'.
!!! error TS2769:   Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'string | null' is not assignable to parameter of type 'number'.
!!! error TS2769:       Type 'null' is not assignable to type 'number'.
!!! related TS2793 arrayBestCommonTypes.ts:65:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
                <number>(this.voidIfAny([undefined, '', null][0]));
                                        ~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2769: No overload matches this call.
!!! error TS2769:   Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'string | null | undefined' is not assignable to parameter of type 'boolean'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'boolean'.
!!! error TS2769:   Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'string | null | undefined' is not assignable to parameter of type 'string'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'string'.
!!! error TS2769:   Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'string | null | undefined' is not assignable to parameter of type 'number'.
!!! error TS2769:       Type 'undefined' is not assignable to type 'number'.
!!! related TS2793 arrayBestCommonTypes.ts:65:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
    
                <number>(this.voidIfAny([[3, 4], [null]][0][0]));
                                        ~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2769: No overload matches this call.
!!! error TS2769:   Overload 1 of 3, '(x: boolean, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | null' is not assignable to parameter of type 'boolean'.
!!! error TS2769:       Type 'null' is not assignable to type 'boolean'.
!!! error TS2769:   Overload 2 of 3, '(x: string, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | null' is not assignable to parameter of type 'string'.
!!! error TS2769:       Type 'null' is not assignable to type 'string'.
!!! error TS2769:   Overload 3 of 3, '(x: number, y?: boolean | undefined): number', gave the following error.
!!! error TS2769:     Argument of type 'number | null' is not assignable to parameter of type 'number'.
!!! error TS2769:       Type 'null' is not assignable to type 'number'.
!!! related TS2793 arrayBestCommonTypes.ts:65:16: The call would have succeeded against this implementation, but implementation signatures of overloads are not externally visible.
    
    
                var t1: { x: number; y: base; }[] = [{ x: 7, y: new derived() }, { x: 5, y: new base() }];
                var t2: { x: boolean; y: base; }[] = [{ x: true, y: new derived() }, { x: false, y: new base() }];
                var t3: { x: string; y: base; }[] = [{ x: undefined, y: new base() }, { x: '', y: new derived() }];
                                                       ~
!!! error TS2322: Type 'undefined' is not assignable to type 'string'.
!!! related TS6500 arrayBestCommonTypes.ts:87:23: The expected type comes from property 'x' which is declared here on type '{ x: string; y: base; }'
    
                var anyObj: any = null;
                // Order matters here so test all the variants
                var a1 = [{ x: 0, y: 'a' }, { x: 'a', y: 'a' }, { x: anyObj, y: 'a' }];
                var a2 = [{ x: anyObj, y: 'a' }, { x: 0, y: 'a' }, { x: 'a', y: 'a' }];
                var a3 = [{ x: 0, y: 'a' }, { x: anyObj, y: 'a' }, { x: 'a', y: 'a' }];
    
                var ifaceObj: iface = null;
                    ~~~~~~~~
!!! error TS2322: Type 'null' is not assignable to type 'iface'.
                var baseObj = new base();
                var base2Obj = new base2();
    
                var b1 = [baseObj, base2Obj, ifaceObj];
                var b2 = [base2Obj, baseObj, ifaceObj];
                var b3 = [baseObj, ifaceObj, base2Obj];
                var b4 = [ifaceObj, baseObj, base2Obj];
            }
        }
    }
    
    