小编pkg*_*ver的帖子

获得改造异常方法返回类型不得在 kotlin 中包含类型变量或通配符

 networkCall = NetworkCall(context)
            val responceCall = networkCall!!.getRetrofit(true).callReadMeService()
            responceCall.clone().enqueue(object : Callback<BaseResponse<*>?> {
                override fun onResponse(call: Call<BaseResponse<*>?>, response: Response<BaseResponse<*>?>) {
                    networkCall!!.dismissLoading()


                    web_view!!.loadData((response.body()?.data as LinkedTreeMap<*, *>)["description"] as String, "text/html", "UTF-8")
                }

                override fun onFailure(call: Call<BaseResponse<*>?>, t: Throwable) {
                    networkCall!!.dismissLoading()

                }
            })
Run Code Online (Sandbox Code Playgroud)

这是api方法

@POST("stories/readme")
fun callReadMeService():   Call<BaseResponse<*>?>
Run Code Online (Sandbox Code Playgroud)

现在我得到这个例外

这是我的 BaseResponse 类

class BaseResponse<T> {

    var message: String? = null
    var status: Boolean = false
    var errors: Array<String>? = null
    var code: String? = null
    var data: T? = null
}
Run Code Online (Sandbox Code Playgroud)

方法返回类型不得包含类型变量或通配符:retrofit2.Call> 用于方法 IApi.callReadMeService

现在我无法从 …

kotlin kotlin-android-extensions

7
推荐指数
1
解决办法
4884
查看次数

标签 统计

kotlin ×1

kotlin-android-extensions ×1