Files
kotlin-fork/compiler/testData/diagnostics/tests/testWithModifiedMockJdk/notConsideredMethod.fir.kt
T
Jinseong Jeon e72ddbcbfe FIR checker: differentiate UNSAFE_CALL from INAPPLICABLE_CANDIDATE
To do so, inside the root cause of inapplicable candidate errors,
we will record expected/actual type of receiver, if any.
That will help identifying inapplicable calls on nullable receiver.
2021-01-29 16:54:23 +03:00

14 lines
495 B
Kotlin
Vendored

// !JDK_KIND: MODIFIED_MOCK_JDK
// !CHECK_TYPE
interface A : MutableCollection<String> {
// Override of deprecated function could be marked as deprecated too
override fun nonExistingMethod(x: String) = ""
}
fun foo(x: MutableCollection<Int>, y: Collection<String>, z: A) {
x.<!UNRESOLVED_REFERENCE!>nonExistingMethod<!>(1).<!UNSAFE_CALL!>checkType<!> { <!INAPPLICABLE_CANDIDATE!>_<!><String>() }
y.<!UNRESOLVED_REFERENCE!>nonExistingMethod<!>("")
z.nonExistingMethod("")
}