tests/cases/compiler/arrayLiteralContextualType.ts(28,5): error TS2345: Argument of type '{}[]' is not assignable to parameter of type 'IAnimal[]'.
  Type '{}' is not assignable to type 'IAnimal'.
tests/cases/compiler/arrayLiteralContextualType.ts(29,5): error TS2345: Argument of type '{}[]' is not assignable to parameter of type '{ [x: number]: IAnimal; }'.


==== tests/cases/compiler/arrayLiteralContextualType.ts (2 errors) ====
    interface IAnimal {
        name: string;
    }
    
    class Giraffe {
        name = "Giraffe";
        neckLength = "3m";
    }
    
    class Elephant {
        name = "Elephant";
        trunkDiameter = "20cm";
    }
    
    function foo(animals: IAnimal[]) { }
    function bar(animals: { [n: number]: IAnimal }) { }
    
    foo([
        new Giraffe(),
        new Elephant()
    ]); // Legal because of the contextual type IAnimal provided by the parameter
    bar([
        new Giraffe(),
        new Elephant()
    ]); // Legal because of the contextual type IAnimal provided by the parameter
    
    var arr = [new Giraffe(), new Elephant()];
    foo(arr); // Error because of no contextual type
        ~~~
!!! error TS2345: Argument of type '{}[]' is not assignable to parameter of type 'IAnimal[]'.
!!! error TS2345:   Type '{}' is not assignable to type 'IAnimal'.
    bar(arr); // Error because of no contextual type
        ~~~
!!! error TS2345: Argument of type '{}[]' is not assignable to parameter of type '{ [x: number]: IAnimal; }'.