Files
2023-07-28 12:57:15 +00:00

41 lines
873 B
Plaintext

// FILE: first.before.kt
// "Propagate 'Api' opt-in requirement to 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
// "Propagate 'Api' opt-in requirement to 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
@Api
class Main {
fun test() {
Bar<caret>()
}
}