Files
Anastasia.Nekrasova 9bf84402e6 [kotlin] Add explicit opt-in in tests with SubclassOptInRequired annotation
At the moment, SubclassOptInRequired is marked with the
ExperimentalSubclassOptIn annotation. However, it does not work
as expected due to a missing opt-in error. To use SubclassOptInRequired,
an explicit opt-in is necessary because SubclassOptInRequired is an
unstable feature now.

^KT-64739

GitOrigin-RevId: a5f43e8755a76c56597aa9f81d9057e2dba4d5c9
2024-01-15 14:21:28 +00:00

17 lines
555 B
Kotlin

// "Propagate 'UnstableApi' opt-in requirement to containing class 'Derived'" "true"
@file:OptIn(ExperimentalSubclassOptIn::class)
@RequiresOptIn
annotation class UnstableApi
@SubclassOptInRequired(UnstableApi::class)
interface Base {
@UnstableApi
fun foo()
}
abstract class Derived : Base {
override fun foo<caret>(){}
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.OptInFixes$HighPriorityPropagateOptInAnnotationFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.OptInFixes$HighPriorityPropagateOptInAnnotationFix