Files
Andrew Kozlov b7d2a6f4ad [kotlin] KTIJ-29507 MakeModuleOptInFix migrated to K2
GitOrigin-RevId: bcd0d0b211c6ae962a3c8844623c789c85370d4a
2024-07-10 23:55:31 +00:00

28 lines
1.0 KiB
Kotlin

// "Propagate 'MyExperimentalAPI' opt-in requirement to 'bar'" "false"
// COMPILER_ARGUMENTS: -opt-in=kotlin.RequiresOptIn
// WITH_STDLIB
// ACTION: Opt in for 'MyExperimentalAPI' in containing file 'basicFunctionNotApplicable.kt'
// ACTION: Opt in for 'MyExperimentalAPI' in module 'light_idea_test_case'
// ACTION: Opt in for 'MyExperimentalAPI' on 'bar'
// ACTION: Opt in for 'MyExperimentalAPI' on containing class 'Bar'
// ACTION: Propagate 'MyExperimentalAPI' opt-in requirement to containing class 'Bar'
// ERROR: This declaration needs opt-in. Its usage must be marked with '@MyExperimentalAPI' or '@OptIn(MyExperimentalAPI::class)'
// ERROR: This declaration needs opt-in. Its usage must be marked with '@MyExperimentalAPI' or '@OptIn(MyExperimentalAPI::class)'
// ERROR: This annotation is not applicable to target 'member function'
@RequiresOptIn
@Target(AnnotationTarget.CLASS)
annotation class MyExperimentalAPI
@MyExperimentalAPI
class Some {
@MyExperimentalAPI
fun foo() {}
}
class Bar {
fun bar() {
Some().foo<caret>()
}
}