tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts(18,3): error TS2345: Argument of type '{ a: string; b: string; }' is not assignable to parameter of type 'Foo | Other'.
  Type '{ a: string; b: string; }' is not assignable to type 'Foo'.
    Types of property 'b' are incompatible.
      Type 'string' is not assignable to type 'number'.
tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts(19,12): error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts(24,5): error TS2345: Argument of type '{ a: string; b: string; }' is not assignable to parameter of type 'Bar | Other'.
  Object literal may only specify known properties, and 'a' does not exist in type 'Bar | Other'.
tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts(42,10): error TS2345: Argument of type '{ dog: string; }' is not assignable to parameter of type 'ExoticAnimal'.
  Property 'cat' is missing in type '{ dog: string; }' but required in type 'CatDog'.
tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts(43,10): error TS2345: Argument of type '{ man: string; bear: string; }' is not assignable to parameter of type 'ExoticAnimal'.
  Property 'pig' is missing in type '{ man: string; bear: string; }' but required in type 'ManBearPig'.
tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts(46,26): error TS2345: Argument of type '{ man: string; beer: string; }' is not assignable to parameter of type 'ExoticAnimal'.
  Object literal may only specify known properties, and 'beer' does not exist in type 'ExoticAnimal'.
tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts(47,10): error TS2345: Argument of type '{ man: string; beer: string; }' is not assignable to parameter of type 'ExoticAnimal'.
  Type '{ man: string; beer: string; }' is missing the following properties from type 'ManBearPig': bear, pig


==== tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts (7 errors) ====
    interface Foo {
        a: string;
        b: number;
    };
    
    interface Bar {
        b: string;
    }
    
    interface Other {
        totallyUnrelatedProperty: number;
    }
    
    export let x = { a: '', b: '' };
    
    declare function f(x: Foo | Other): any;
    
    f(x);
      ~
!!! error TS2345: Argument of type '{ a: string; b: string; }' is not assignable to parameter of type 'Foo | Other'.
!!! error TS2345:   Type '{ a: string; b: string; }' is not assignable to type 'Foo'.
!!! error TS2345:     Types of property 'b' are incompatible.
!!! error TS2345:       Type 'string' is not assignable to type 'number'.
    f({ a: '', b: '' })
               ~
!!! error TS2322: Type 'string' is not assignable to type 'number'.
    
    declare function g(x: Bar | Other): any;
    
    g(x);
    g({ a: '', b: '' })
        ~
!!! error TS2345: Argument of type '{ a: string; b: string; }' is not assignable to parameter of type 'Bar | Other'.
!!! error TS2345:   Object literal may only specify known properties, and 'a' does not exist in type 'Bar | Other'.
    
    declare function h(x: Foo | Bar | Other): any;
    
    h(x);
    h({ a: '', b: '' })
    
    interface CatDog { cat: any, dog: any }
    interface ManBearPig { man: any, bear: any, pig: any }
    interface Platypus { platypus: any }
    
    type ExoticAnimal =
        | CatDog
        | ManBearPig
        | Platypus;
    
    declare function addToZoo(animal: ExoticAnimal): void;
    
    addToZoo({ dog: "Barky McBarkface" });
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '{ dog: string; }' is not assignable to parameter of type 'ExoticAnimal'.
!!! error TS2345:   Property 'cat' is missing in type '{ dog: string; }' but required in type 'CatDog'.
!!! related TS2728 tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts:31:20: 'cat' is declared here.
    addToZoo({ man: "Manny", bear: "Coffee" });
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2345: Argument of type '{ man: string; bear: string; }' is not assignable to parameter of type 'ExoticAnimal'.
!!! error TS2345:   Property 'pig' is missing in type '{ man: string; bear: string; }' but required in type 'ManBearPig'.
!!! related TS2728 tests/cases/compiler/errorsOnUnionsOfOverlappingObjects01.ts:32:45: 'pig' is declared here.
    
    const manBeer = { man: "Manny", beer: "Coffee" };
    addToZoo({ man: "Manny", beer: "Coffee" });
                             ~~~~
!!! error TS2345: Argument of type '{ man: string; beer: string; }' is not assignable to parameter of type 'ExoticAnimal'.
!!! error TS2345:   Object literal may only specify known properties, and 'beer' does not exist in type 'ExoticAnimal'.
    addToZoo(manBeer);
             ~~~~~~~
!!! error TS2345: Argument of type '{ man: string; beer: string; }' is not assignable to parameter of type 'ExoticAnimal'.
!!! error TS2345:   Type '{ man: string; beer: string; }' is missing the following properties from type 'ManBearPig': bear, pig