FIR: report UNSAFE_CALL on dot when possible

This commit is contained in:
Mikhail Glukhikh
2021-01-29 10:25:59 +03:00
parent 0ee4f1f393
commit 7d4eaefd36
249 changed files with 1208 additions and 1649 deletions
@@ -17,12 +17,12 @@ public interface J2 extends J {
// FILE: main.kt
fun main() {
<!INAPPLICABLE_CANDIDATE!>J<!> { s: String -> s} // should be prohibited, because SAM value parameter has nullable type
J { "" + it.<!UNSAFE_CALL!>length<!> }
J { "" + it<!UNSAFE_CALL!>.<!>length }
J { null }
J { it?.length?.toString() }
<!INAPPLICABLE_CANDIDATE!>J2<!> { s: String -> s}
J2 { "" + it.<!UNSAFE_CALL!>length<!> }
J2 { "" + it<!UNSAFE_CALL!>.<!>length }
J2 { null }
J2 { it?.length?.toString() }
}