contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts(2,40): error TS2322: Type 'null' is not assignable to type 'U'.
  'U' could be instantiated with an arbitrary type which could be unrelated to 'null'.
contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts(6,9): error TS2454: Variable 'h' is used before being assigned.


==== contextualSignatureInstantiationWithTypeParameterConstrainedToOuterTypeParameter.ts (2 errors) ====
    function f<T>() {
        function g<U extends T>(u: U): U { return null }
                                           ~~~~~~
!!! error TS2322: Type 'null' is not assignable to type 'U'.
!!! error TS2322:   'U' could be instantiated with an arbitrary type which could be unrelated to 'null'.
        return g;
    }
    var h: <V, W>(v: V, func: (v: V) => W) => W;
    var x = h("", f<string>()); // Call should succeed and x should be string. All type parameters should be instantiated to string
            ~
!!! error TS2454: Variable 'h' is used before being assigned.