title: Typescript: Index signature is missing in type
body: <p>I want <code>MyInterface.dic</code> to be like a dictionary <code>name: value</code>, I define it as follows:</p>
  
  <pre><code>interface MyInterface {
      dic: { [name: string]: number }
  }
  </code></pre>
  
  <p>Now I create a function which waits for my type:</p>
  
  <pre><code>function foo(a: MyInterface) {
      ...
  }
  </code></pre>
  
  <p>And the input:</p>
  
  <pre><code>let o = {
      dic: {
          'a': 3,
          'b': 5
      }
  }
  </code></pre>
  
  <p>I'm expecting <code>foo(o)</code> to be correct, but the compiler is falling: </p>
  
  <pre><code>foo(o) // Typescript error: Index signature is missing in type { 'a': number, 'b': number }
  </code></pre>
  
  <p>I know there is a possible casting: <code>let o: MyInterface = { ... }</code> which do the trick but the question is, <strong>why</strong> typescript is not recognizing my type?</p>
  
  <hr>
  
  <p>Extra: works fine if <code>o</code> is declared inline: </p>
  
  <pre><code>foo({ 
    dic: {
      'a': 3, 
      'b': 5
    }
  })
  </code></pre>