I am trying to call function to marshal HttpResponse from spray. unmarshal
function described here. response is HttpResponse
Consider 3 code variants:
First
val func = unmarshal[MyType]
func(response)
Second
unmarshal[MyType].apply(response)
Third
unmarshal[MyType](response)
Why does my third code variant does not compile while first two are works? The compiler returns:
[error] found : spray.http.HttpResponse
[error] required: spray.httpx.unmarshalling.FromResponseUnmarshaller[MyType]
[error] (which expands to) spray.httpx.unmarshalling.Deserializer[spray.http.HttpResponse,MyType]
[error] unmarshal[MyType](response)
Is there a way to call function returned by unmarshal
more elegant then create temp variable or direct call apply
method?