==== tests/cases/compiler/assignmentCompatWithObjectMembers4.ts (17 errors) ====
    // members N and M of types S and T have the same name, same accessibility, same optionality, and N is not assignable M
    
    module OnlyDerived {
        class Base { foo: string; }
        class Derived extends Base { bar: string; }
        class Derived2 extends Base { baz: string; }
    
        class S { foo: Derived; }
        class T { foo: Derived2; }
        var s: S;
        var t: T;
    
        interface S2 { foo: Derived; }
        interface T2 { foo: Derived2; }
        var s2: S2;
        var t2: T2;
    
        var a: { foo: Derived; }
        var b: { foo: Derived2; }
    
        var a2 = { foo: new Derived() };
        var b2 = { foo: new Derived2() };
    
        s = t; // error
        ~
!!! assignmentCompatWithObjectMembers4.ts(24,5): error TS2012: Cannot convert 'T' to 'S':
!!! 	Types of property 'foo' of types 'T' and 'S' are incompatible:
!!! 		Type 'Derived2' is missing property 'bar' from type 'Derived'.
        t = s; // error
        ~
!!! assignmentCompatWithObjectMembers4.ts(25,5): error TS2012: Cannot convert 'S' to 'T':
!!! 	Types of property 'foo' of types 'S' and 'T' are incompatible:
!!! 		Type 'Derived' is missing property 'baz' from type 'Derived2'.
        s = s2; // ok
        s = a2; // ok
    
        s2 = t2; // error
        ~~
!!! assignmentCompatWithObjectMembers4.ts(29,5): error TS2012: Cannot convert 'T2' to 'S2':
!!! 	Types of property 'foo' of types 'T2' and 'S2' are incompatible:
!!! 		Type 'Derived2' is missing property 'bar' from type 'Derived'.
        t2 = s2; // error
        ~~
!!! assignmentCompatWithObjectMembers4.ts(30,5): error TS2012: Cannot convert 'S2' to 'T2':
!!! 	Types of property 'foo' of types 'S2' and 'T2' are incompatible:
!!! 		Type 'Derived' is missing property 'baz' from type 'Derived2'.
        s2 = t; // error
        ~~
!!! assignmentCompatWithObjectMembers4.ts(31,5): error TS2012: Cannot convert 'T' to 'S2':
!!! 	Types of property 'foo' of types 'T' and 'S2' are incompatible:
!!! 		Type 'Derived2' is missing property 'bar' from type 'Derived'.
        s2 = b; // error
        ~~
!!! assignmentCompatWithObjectMembers4.ts(32,5): error TS2012: Cannot convert '{ foo: Derived2; }' to 'S2':
!!! 	Types of property 'foo' of types '{ foo: Derived2; }' and 'S2' are incompatible:
!!! 		Type 'Derived2' is missing property 'bar' from type 'Derived'.
        s2 = a2; // ok
    
        a = b; // error
        ~
!!! assignmentCompatWithObjectMembers4.ts(35,5): error TS2012: Cannot convert '{ foo: Derived2; }' to '{ foo: Derived; }':
!!! 	Types of property 'foo' of types '{ foo: Derived2; }' and '{ foo: Derived; }' are incompatible:
!!! 		Type 'Derived2' is missing property 'bar' from type 'Derived'.
        b = a; // error
        ~
!!! assignmentCompatWithObjectMembers4.ts(36,5): error TS2012: Cannot convert '{ foo: Derived; }' to '{ foo: Derived2; }':
!!! 	Types of property 'foo' of types '{ foo: Derived; }' and '{ foo: Derived2; }' are incompatible:
!!! 		Type 'Derived' is missing property 'baz' from type 'Derived2'.
        a = s; // ok
        a = s2; // ok
        a = a2; // ok
    
        a2 = b2; // error
        ~~
!!! assignmentCompatWithObjectMembers4.ts(41,5): error TS2012: Cannot convert '{ foo: Derived2; }' to '{ foo: Derived; }':
!!! 	Types of property 'foo' of types '{ foo: Derived2; }' and '{ foo: Derived; }' are incompatible:
!!! 		Type 'Derived2' is missing property 'bar' from type 'Derived'.
        b2 = a2; // error
        ~~
!!! assignmentCompatWithObjectMembers4.ts(42,5): error TS2012: Cannot convert '{ foo: Derived; }' to '{ foo: Derived2; }':
!!! 	Types of property 'foo' of types '{ foo: Derived; }' and '{ foo: Derived2; }' are incompatible:
!!! 		Type 'Derived' is missing property 'baz' from type 'Derived2'.
        a2 = b; // error
        ~~
!!! assignmentCompatWithObjectMembers4.ts(43,5): error TS2012: Cannot convert '{ foo: Derived2; }' to '{ foo: Derived; }':
!!! 	Types of property 'foo' of types '{ foo: Derived2; }' and '{ foo: Derived; }' are incompatible:
!!! 		Type 'Derived2' is missing property 'bar' from type 'Derived'.
        a2 = t2; // error
        ~~
!!! assignmentCompatWithObjectMembers4.ts(44,5): error TS2012: Cannot convert 'T2' to '{ foo: Derived; }':
!!! 	Types of property 'foo' of types 'T2' and '{ foo: Derived; }' are incompatible:
!!! 		Type 'Derived2' is missing property 'bar' from type 'Derived'.
        a2 = t; // error
        ~~
!!! assignmentCompatWithObjectMembers4.ts(45,5): error TS2012: Cannot convert 'T' to '{ foo: Derived; }':
!!! 	Types of property 'foo' of types 'T' and '{ foo: Derived; }' are incompatible:
!!! 		Type 'Derived2' is missing property 'bar' from type 'Derived'.
    }
    
    module WithBase {
        class Base { foo: string; }
        class Derived extends Base { bar: string; }
        class Derived2 extends Base { baz: string; }
    
        class S { foo: Base; }
        class T { foo: Derived2; }
        var s: S;
        var t: T;
    
        interface S2 { foo: Base; }
        interface T2 { foo: Derived2; }
        var s2: S2;
        var t2: T2;
    
        var a: { foo: Base; }
        var b: { foo: Derived2; }
    
        var a2 = { foo: new Base() };
        var b2 = { foo: new Derived2() };
    
        s = t; // ok
        t = s; // error
        ~
!!! assignmentCompatWithObjectMembers4.ts(70,5): error TS2012: Cannot convert 'S' to 'T':
!!! 	Types of property 'foo' of types 'S' and 'T' are incompatible:
!!! 		Type 'Base' is missing property 'baz' from type 'Derived2'.
        s = s2; // ok
        s = a2; // ok
    
        s2 = t2; // ok
        t2 = s2; // error
        ~~
!!! assignmentCompatWithObjectMembers4.ts(75,5): error TS2012: Cannot convert 'S2' to 'T2':
!!! 	Types of property 'foo' of types 'S2' and 'T2' are incompatible:
!!! 		Type 'Base' is missing property 'baz' from type 'Derived2'.
        s2 = t; // ok
        s2 = b; // ok
        s2 = a2; // ok
    
        a = b; // ok
        b = a; // error
        ~
!!! assignmentCompatWithObjectMembers4.ts(81,5): error TS2012: Cannot convert '{ foo: Base; }' to '{ foo: Derived2; }':
!!! 	Types of property 'foo' of types '{ foo: Base; }' and '{ foo: Derived2; }' are incompatible:
!!! 		Type 'Base' is missing property 'baz' from type 'Derived2'.
        a = s; // ok
        a = s2; // ok
        a = a2; // ok
    
        a2 = b2; // ok
        b2 = a2; // error
        ~~
!!! assignmentCompatWithObjectMembers4.ts(87,5): error TS2012: Cannot convert '{ foo: Base; }' to '{ foo: Derived2; }':
!!! 	Types of property 'foo' of types '{ foo: Base; }' and '{ foo: Derived2; }' are incompatible:
!!! 		Type 'Base' is missing property 'baz' from type 'Derived2'.
        a2 = b; // ok
        a2 = t2; // ok
        a2 = t; // ok
    }