Error:(65, 52) java: incompatible types: inference variable U has incompatible bounds equality constraints: akka.http.javadsl.model.HttpResponse lower bounds: com.myactors.ChatActor.ChatMessagejava的:不兼容的类型:推断变量U具有不相容边界
下面的行示出了编译错误:
CompletionStage<HttpResponse> httpResponse =
postChat(url,
context().system(), chatData)
.thenApplyAsync(httpResponse -> new ChatActor.ChatMessage(httpResponse,"1234"));
public static class ChatMessage{
HttpResponse httpResponse;
String name;
public ChatMessage(HttpResponse httpResponse, String name) {
this.httpResponse = httpResponse;
this.name = name;
}
public HttpResponse getHttpResponse() {
return httpResponse;
}
public String getname() {
return name;
}
}
这里的HttpResponse被阿卡的Http的。
我不知道它在说什么。 解决方法是什么?
显示您的课ChatMessage –
那么thenApplyAsync是从哪里来的? –
@avy:问题不明确,你可能需要看看http://stackoverflow.com/questions/27522741/incompatible-types-inference-variable-t-has-incompatible-bounds – Shankar