Fix resolution of callable references

When there is unsuccessful (e.g invisible) result of one kind (static/non-static)
and there is a successful candidate for another kind, choose the latter one.

Note, that we have to postpone commiting trace until we choose one of the results,
otherwise errors of unsuccessful results are reported

TODO: Maybe it makes sense to report all results when all of them are
unsuccessful (NONE_APPLICABLE or something like this)

 #KT-16278 Fixed
This commit is contained in:
Denis Zharkov
2017-02-10 15:29:57 +03:00
parent dd61a5b2c6
commit b5a8ffaddc
4 changed files with 93 additions and 47 deletions
@@ -0,0 +1,10 @@
// SKIP_TXT
// FILE: A.java
class A {
private static void foo() {}
public String foo(int x) {}
}
// FILE: main.kt
fun main() {
(A::foo)(A(), 1)
}