inferentialTypingUsingApparentType2.ts(2,5): error TS2322: Type 'undefined' is not assignable to type 'T'.
  'T' could be instantiated with an arbitrary type which could be unrelated to 'undefined'.


==== inferentialTypingUsingApparentType2.ts (1 errors) ====
    function foo<T extends { m(p: string): number }>(x: T): T {
        return undefined;
        ~~~~~~
!!! error TS2322: Type 'undefined' is not assignable to type 'T'.
!!! error TS2322:   'T' could be instantiated with an arbitrary type which could be unrelated to 'undefined'.
    }
    
    foo({ m(x) { return x.length } });