title: Argument of type '() => Promise<string>' is not assignable to parameter of type 'Promise<string>'. ts(2345)
body: <p>I'm defining a function that requires a asynchronous function as a parameter:</p>
  <pre class="lang-js prettyprint-override"><code>async function handle(def: Promise&lt;string&gt;) {
      // ...
      const data = await def;
      console.log(`data equals: ${data}`)
  }
  </code></pre>
  <p>I can succesfully execute this by passing a promise.</p>
  <pre class="lang-js prettyprint-override"><code>handle(new Promise(async (res, rej) =&gt; {
      const data = await Promise.resolve(&quot;some data&quot;)
      if (data == &quot;invalid&quot;)
          return rej(&quot;data is invalid&quot;)
      res(data)
  }))
  </code></pre>
  <p>I need the inner-function to be async, since I need to perform awaits inside. However, I dislike the async in the promise and read online that <a href="https://stackoverflow.com/a/43050114/17864167">its considered an anti-pattern</a>.</p>
  <p>I thought it was a better idea to get rid of the promise and use a basic async function:</p>
  <pre class="lang-js prettyprint-override"><code>handle(async () =&gt; {
      const data = await Promise.resolve(&quot;some data&quot;)
      if (data == &quot;invalid&quot;)
          throw &quot;data is invalid&quot;
      return data
  })
  </code></pre>
  <p>But the TS compiler raises the error:</p>
  <pre><code>Argument of type '() =&gt; Promise&lt;string&gt;' is not assignable to parameter of type 'Promise&lt;string&gt;'. ts(2345)
  </code></pre>
  <p>I thought that Promises and async functions are somewhat interchangable. I read that async functions <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function#description" rel="nofollow noreferrer">always return a promise</a>. Apperantly I am not interpreting this correctly, but I'm unsure what the error is telling me.</p>
  <p>I hope the problem I am sketching is clear. It would be greatly appreciated if someone could clarify the error or give suggestions on how to implement this in the desired way. Big thanks!</p>