Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 287 Vote(s) - 3.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Type inference failed. the value of the type parameter t should be mentioned in input types

#1
I am beginner at kotlin and I am trying to filter items which are present in one list, however i am using a loop and iterator for this purpose. I am getting mentioned exception in the if condition `in` here . Can some one guide me where i am wrong.
I am pasting my function here .

fun getGateWays(
gateways: ArrayList<JsonObject>?,
callback: ResponseCallback<ArrayList<JsonObject>, String>
) {


getDistinctGateways(object : ResponseCallback<List<String>?, String>() {

override fun onFailure(failure: String) {
}

override fun onSuccess(response: List<String>?) {

for(e in gateways!!.iterator()){
if(e.get("value") in response){
gateways.remove(e)
}
}
callback.onSuccess(gateways!!)
}

})

}
Reply

#2
This is because

gateways.iterator() will give Iterator<JsonObject>
e is of JsonObject type and response is the type List<String>

Reply

#3
You have to get a string value of each gateway in the list. You can do it with `asString` method of `JsonObject`:
```
if (e.get("value").asString in response!!) {
gateways.remove(e)
}
```
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through