title: Scala Play Action.async cant resolve Ok as mvc.AnyContent
body: <p>The following controller action cause the error: </p>
  
  <pre><code>(block: =&gt; scala.concurrent.Future[play.api.mvc.SimpleResult])play.api.mvc.Action[play.api.mvc.AnyContent]  cannot be applied to (scala.concurrent.Future[Object])". 
  </code></pre>
  
  <p>Every Future inside the action should be <code>Ok()</code> so I don't understand why scala can't resolve the futures correctly.</p>
  
  <pre><code>def form = Action.async {
    val checkSetup: Future[Response] = EsClient.execute(new IndexExistsQuery("fbl_indices"))
    checkSetup map {
      case result if result.status == 200 =&gt; Ok("form")
      case result =&gt; {
        val createIndexResult: Future[Response] = EsClient.execute(new FillableSetupQuery())
        createIndexResult map {
          indexCreated =&gt; Ok("form").flashing("success" -&gt; "alles tutti")
        } recover {
          case e: Throwable =&gt; Ok("form error").flashing("message" -&gt; "error indexerzeugung")
        }
      }
    } recover {
      case e: Throwable =&gt; Ok("form error").flashing("message" -&gt; "error index query")
    }
  }
  </code></pre>
  
  <p>Complete Error messages:</p>
  
  <pre><code>overloaded method value async with alternatives: [A](bodyParser: play.api.mvc.BodyParser[A])(block: play.api.mvc.Request[A] =&gt; scala.concurrent.Future[play.api.mvc.SimpleResult])play.api.mvc.Action[A] &lt;and&gt;   (block: play.api.mvc.Request[play.api.mvc.AnyContent] =&gt; scala.concurrent.Future[play.api.mvc.SimpleResult])play.api.mvc.Action[play.api.mvc.AnyContent] &lt;and&gt;   (block: =&gt; scala.concurrent.Future[play.api.mvc.SimpleResult])play.api.mvc.Action[play.api.mvc.AnyContent]  cannot be applied to (scala.concurrent.Future[Object])
  </code></pre>