Fix Android api issues reporting for generic collection method calls

#KT-16712 Fixed
This commit is contained in:
Vyacheslav Gerasimov
2017-04-26 22:42:56 +03:00
parent 9552666aa6
commit 5f09e18394
2 changed files with 23 additions and 0 deletions
+18
View File
@@ -458,4 +458,22 @@ object O: Activity() {
fun test() {
<error descr="Call requires API level 21 (current min is 1): android.content.Context#getDrawable">getDrawable</error>(0)
}
}
fun testJava8() {
// Error, Api 24, Java8
mutableListOf(1, 2, 3).<error descr="Call requires API level 24 (current min is 1): java.util.Collection#removeIf">removeIf</error> {
true
}
// Ok, Kotlin
mutableListOf(1, 2, 3).removeAll {
true
}
// Error, Api 24, Java8
mapOf(1 to 2).<error descr="Call requires API level 24 (current min is 1): java.util.Map#forEach">forEach</error> { key, value -> key + value }
// Ok, Kotlin
mapOf(1 to 2).forEach { (key, value) -> key + value }
}