Files
kotlin-fork/compiler/testData/codegen/bytecodeListing/deprecated/hidden.kt
T
Alexander Udalov 0e91d3fcb0 JVM IR: generate ACC_SYNTHETIC for deprecated-hidden declarations correctly
Extract the logic that computes ACC_SYNTHETIC flag for deprecated
declarations, and use `DeprecationResolver` as the old backend does in
`DescriptorAsmUtil.getCommonCallableFlags`. Creating IR-based
descriptors for each function to pass it there is a bit costly though,
so as a small optimization, use `allOverridden` to check if anything in
the method hierarchy is deprecated.

Also optimize `allOverridden` for the case of linear inheritance which
is far more common.

 #KT-43199 Fixed
2020-11-09 19:47:54 +01:00

17 lines
355 B
Kotlin
Vendored

@Deprecated("")
@Suppress("DEPRECATED_SINCE_KOTLIN_OUTSIDE_KOTLIN_SUBPACKAGE")
@DeprecatedSinceKotlin(hiddenSince = "1.0")
fun hidden() {}
open class Base {
@Deprecated("", level = DeprecationLevel.HIDDEN)
open fun f() {}
}
class Derived : Base {
@Deprecated("", level = DeprecationLevel.HIDDEN)
constructor()
override fun f() {}
}