Seems like a bug in the design of ActionRefiner

This simple code doesn’t seem to work with the way the Request types are currently designed.

class APIRequest[A](val apiKey: Option[String], request: Request[A]) extends WrappedRequest[A](request)

    def APIAction(itemId: String)(implicit ec: ExecutionContext) = new ActionRefiner[Request, APIRequest] {
        def executionContext = ec
        def refine[A](request: Request[AnyContent]) = Future.successful {
            val maybeQueryApiKey = request.getQueryString(API_KEY)

            val maybeBodyapiKey = {
                Try {
                    val json = request.body.asJson
                    for (j <- json) yield {

                        (j \ "apiKey").asOpt[String]
                    }
                }
                None
            }
            Some(new APIRequest(None, request)).toRight(Forbidden)
        }
    }

Error

object creation impossible, since method refine in trait ActionRefiner of type [A](request: play.api.mvc.Request[A])scala.concurrent.Future[Either[play.api.mvc.Result,com.cortex.web.security.Security.APIRequest[A]]] is not defined
[error] (Note that R[A] does not match play.api.mvc.Request[play.api.mvc.AnyContent])
[error]     def APIAction(itemId: String)(implicit ec: ExecutionContext) = new ActionRefiner[Request, APIRequest] {