contextuallyTypedParametersWithQuestionToken.ts(6,13): error TS2345: Argument of type 'number | undefined' is not assignable to parameter of type 'number'.
  Type 'undefined' is not assignable to type 'number'.
contextuallyTypedParametersWithQuestionToken.ts(12,13): error TS2345: Argument of type 'number | undefined' is not assignable to parameter of type 'number'.
  Type 'undefined' is not assignable to type 'number'.


==== contextuallyTypedParametersWithQuestionToken.ts (2 errors) ====
    // https://github.com/microsoft/TypeScript/issues/54948
    
    function acceptNum(num: number) {}
    
    const f1: (a: string, b: number) => void = function self(a, b?) {
      acceptNum(b); // error
                ~
!!! error TS2345: Argument of type 'number | undefined' is not assignable to parameter of type 'number'.
!!! error TS2345:   Type 'undefined' is not assignable to type 'number'.
      self("");
      self("", undefined);
    };
    
    const f2: (a: string, b: number) => void = function self(a, b?: number) {
      acceptNum(b); // error
                ~
!!! error TS2345: Argument of type 'number | undefined' is not assignable to parameter of type 'number'.
!!! error TS2345:   Type 'undefined' is not assignable to type 'number'.
      self("");
      self("", undefined);
    };
    