jdemeulenaere
10/23/2019, 9:10 AMval context: BindingContext = ...
val callExpression: KtCallExpression = ...
val call = callExpression.getCall(context)
val resolvedDescriptor = call?.getResolvedCall(context)?.candidateDescriptor
if (resolvedDescriptor == null) {
// TODO: Find a list of candidate descriptors.
}
For example, the following code:
fun hello(s: String) { ... }
fun helloWithOverload(s: String) { ... }
fun helloWithOverload(i: Int) { ... }
fun main() {
hello("foo") // will be correctly resolved
hello() // will be correctly resolved as there is only one possible call
helloWithOverload("foo") // will be correctly resolved as the call is complete
helloWithOverload() // won't be resolved as the call is incomplete and there are multiple candidates
}
My question: what methods can I use to find those candidates ?
Thanks a lot 🙂raulraja
10/23/2019, 11:19 AM