inferentialTypingUsingApparentType1.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'.


==== inferentialTypingUsingApparentType1.ts (1 errors) ====
    function foo<T extends (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(x => x.length);