e90c92f8d3
- White list: can be used as common built-in declaration - Black list: can be used only for overrides and super-calls- - Not considered members: ones that is not in black or white list. Such members can be used in any context, but they usages marked as deprecated Third kind is needed to make possible use declarations added in future JDK versions. Deprecation is necessary because they may get into black list in next Kotlin compiler version
13 lines
416 B
Kotlin
Vendored
13 lines
416 B
Kotlin
Vendored
// !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.<!DEPRECATION!>nonExistingMethod<!>(1).checkType { _<String>() }
|
|
y.<!DEPRECATION!>nonExistingMethod<!>("")
|
|
z.<!DEPRECATION!>nonExistingMethod<!>("")
|
|
}
|