mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
^KTIJ-26302 GitOrigin-RevId: 8d463b04322327abd25978d7b6c127ba8de02c44
41 lines
851 B
Plaintext
41 lines
851 B
Plaintext
// FILE: first.before.kt
|
|
// "Opt in for 'Api' on containing class 'Main'" "true"
|
|
// ERROR: This declaration needs opt-in. Its usage must be marked with '@foo.Api' or '@OptIn(foo.Api::class)'
|
|
import foo.Bar
|
|
|
|
class Main {
|
|
fun test() {
|
|
Bar<caret>()
|
|
}
|
|
}
|
|
|
|
// FILE: foo/Api.java
|
|
// WITH_STDLIB
|
|
package foo;
|
|
|
|
import kotlin.RequiresOptIn;
|
|
import java.lang.annotation.ElementType;
|
|
import java.lang.annotation.Target;
|
|
|
|
@RequiresOptIn
|
|
@Target(ElementType.TYPE)
|
|
public @interface Api{}
|
|
|
|
// FILE: foo/Bar.java
|
|
package foo;
|
|
|
|
@Api
|
|
public class Bar {}
|
|
|
|
// FILE: first.after.kt
|
|
// "Opt in for 'Api' on containing class 'Main'" "true"
|
|
// ERROR: This declaration needs opt-in. Its usage must be marked with '@foo.Api' or '@OptIn(foo.Api::class)'
|
|
import foo.Api
|
|
import foo.Bar
|
|
|
|
@OptIn(Api::class)
|
|
class Main {
|
|
fun test() {
|
|
Bar<caret>()
|
|
}
|
|
} |