[FIR] Handle fully qualified expressions separately in tower resolver

This commit is contained in:
Mikhail Glukhikh
2020-01-10 17:11:43 +03:00
parent 587430ff90
commit 5c6341b4e4
36 changed files with 204 additions and 47 deletions
@@ -1,7 +1,7 @@
// KT-459 Type argument inference fails when class names are fully qualified
fun test() {
val attributes : java.util.HashMap<String, String> = java.util.<!UNRESOLVED_REFERENCE!>HashMap<!>() // failure!
val attributes : java.util.HashMap<String, String> = java.util.HashMap() // failure!
attributes["href"] = "1" // inference fails, but it shouldn't
}
@@ -3,9 +3,9 @@
package demo
fun <T> filter(list : Array<T>, filter : (T) -> Boolean) : List<T> {
val answer = java.util.<!UNRESOLVED_REFERENCE!>ArrayList<!><T>();
val answer = java.util.ArrayList<T>();
for (l in list) {
if (filter(l)) answer.<!UNRESOLVED_REFERENCE!>add<!>(l)
if (filter(l)) answer.add(l)
}
return answer;
}