tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints3.ts(18,12): error TS2345: Argument of type '{ x: Derived; y: Derived2; }' is not assignable to parameter of type '{ x: Derived; y: Derived; }'.
  Types of property 'y' are incompatible.
    Type 'Derived2' is not assignable to type 'Derived'.
      Property 'y' is missing in type 'Derived2'.


==== tests/cases/conformance/types/typeRelationships/typeInference/genericCallWithObjectTypeArgsAndConstraints3.ts (1 errors) ====
    // Generic call with constraints infering type parameter from object member properties
    
    class Base {
        x: string;
    }
    class Derived extends Base {
        y: string;
    }
    class Derived2 extends Base {
        z: string;
    }
    
    function f<T extends Base>(a: { x: T; y: T }) {
        var r: T;
        return r;
    }
    
    var r1 = f({ x: new Derived(), y: new Derived2() }); // error because neither is supertype of the other
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '{ x: Derived; y: Derived2; }' is not assignable to parameter of type '{ x: Derived; y: Derived; }'.
!!! error TS2345:   Types of property 'y' are incompatible.
!!! error TS2345:     Type 'Derived2' is not assignable to type 'Derived'.
!!! error TS2345:       Property 'y' is missing in type 'Derived2'.
    
    function f2<T extends Base, U extends { x: T; y: T }>(a: U) {
        var r: T;
        return r;
    }
    
    var r2 = f2({ x: new Derived(), y: new Derived2() }); // ok
    var r3 = f2({ x: new Derived(), y: new Derived2() }); // ok
    
    
    function f3<T extends Base>(y: (a: T) => T, x: T) {
        return y(null);
    }
    
    // all ok - second argument is processed before x is fixed
    var r4 = f3(x => x, new Base());
    var r5 = f3(x => x, new Derived());
    var r6 = f3(x => x, null);
    