title: TypeScript: void return type converted to any type?
body: <p>I seem to be not able to comprehend why the following code does not raise error:</p>
  
  <pre><code>var rg: {(): void;}[] = [];
  rg.push(function():string {return "";})
  </code></pre>
  
  <p>I clearly state that the type should be an array of functions that return <code>void</code>, however I push there a function that returns a <code>string</code> and yet the compiler does not complain. If I change the definition of <code>rg</code> to </p>
  
  <pre><code>var rg: {():number;}[] = [];
  </code></pre>
  
  <p>The compiler starts to complain.</p>
  
  <p>Is this a bug or is it how the void return type is supposed to work (i.e. anything goes if <code>void</code> is used, basically making it the same as return type <code>any</code>)?</p>