tests/cases/compiler/fixingTypeParametersRepeatedly2.ts(11,32): error TS2322: Type 'Base' is not assignable to type 'Derived'.
  Property 'toBase' is missing in type 'Base'.


==== tests/cases/compiler/fixingTypeParametersRepeatedly2.ts (1 errors) ====
    interface Base {
        baseProp;
    }
    interface Derived extends Base {
        toBase(): Base;
    }
    
    var derived: Derived;
    
    declare function foo<T>(x: T, func: (p: T) => T): T;
    var result = foo(derived, d => d.toBase());
                                   ~~~~~~~~~~
!!! error TS2322: Type 'Base' is not assignable to type 'Derived'.
!!! error TS2322:   Property 'toBase' is missing in type 'Base'.
!!! related TS6502 tests/cases/compiler/fixingTypeParametersRepeatedly2.ts:10:37: The expected type comes from the return type of this signature.
    
    // bar should type check just like foo.
    // The same error should be observed in both cases.
    declare function bar<T>(x: T, func: (p: T) => T): T;
    declare function bar<T>(x: T, func: (p: T) => T): T;
    var result = bar(derived, d => d.toBase());