title: Typescript compile error in promise.then
body: <p>I'm trying to use promises in typescript.  I used tsd to install es6-promise and added the reference to my file.  It understands promises for the most part, but I'm having difficulty chaining them with <code>then</code>.</p>
  
  <pre><code>function foo() : Promise&lt;any&gt; {
    var p: Promise&lt;any&gt; = Promise.resolve();
    var x: Promise&lt;any&gt; = Promise.resolve();
    p = p.then(x);
    return p;
  }
  </code></pre>
  
  <p>gives me this at the location of <code>p.then(x)</code>:</p>
  
  <blockquote>
    <p>error TS2345: Argument of type 'Promise' is not assignable to parameter of type '(value: any) => {} | Thenable&lt;{}>'.</p>
  </blockquote>
  
  <p>Is this somehow a bug in the <a href="https://github.com/borisyankov/DefinitelyTyped/blob/master/es6-promise/es6-promise.d.ts" rel="nofollow">type definition</a>, or am I using it wrong?</p>