FIR: report OPT_IN_OVERRIDE(_ERROR) diagnostics
This commit is contained in:
committed by
TeamCityServer
parent
4052befe88
commit
ac3b738d9b
@@ -1,27 +0,0 @@
|
||||
// !OPT_IN: kotlin.RequiresOptIn
|
||||
// FILE: api.kt
|
||||
|
||||
package api
|
||||
|
||||
@RequiresOptIn
|
||||
@Retention(AnnotationRetention.BINARY)
|
||||
annotation class E
|
||||
|
||||
open class Base {
|
||||
@E
|
||||
open fun foo() {}
|
||||
}
|
||||
|
||||
// FILE: usage.kt
|
||||
|
||||
package usage
|
||||
|
||||
import api.*
|
||||
|
||||
class Derived : Base() {
|
||||
override fun foo() {}
|
||||
}
|
||||
|
||||
fun test(b: Base) {
|
||||
b.<!OPT_IN_USAGE_ERROR!>foo<!>()
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !OPT_IN: kotlin.RequiresOptIn
|
||||
// FILE: api.kt
|
||||
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
// !OPT_IN: kotlin.RequiresOptIn
|
||||
// FILE: api.kt
|
||||
|
||||
package api
|
||||
|
||||
@RequiresOptIn(level = RequiresOptIn.Level.WARNING)
|
||||
@Retention(AnnotationRetention.BINARY)
|
||||
annotation class E
|
||||
|
||||
open class Base {
|
||||
@E
|
||||
open fun foo() {}
|
||||
}
|
||||
|
||||
class DerivedInSameModule : Base() {
|
||||
override fun foo() {}
|
||||
}
|
||||
|
||||
// FILE: usage-propagate.kt
|
||||
|
||||
package usage1
|
||||
|
||||
import api.*
|
||||
|
||||
open class Derived : Base() {
|
||||
@E
|
||||
override fun foo() {}
|
||||
}
|
||||
|
||||
class SubDerived : Derived()
|
||||
|
||||
@E
|
||||
class Derived2 : Base() {
|
||||
override fun foo() {}
|
||||
}
|
||||
|
||||
// FILE: usage-none.kt
|
||||
|
||||
package usage2
|
||||
|
||||
import api.*
|
||||
|
||||
class Derived : Base() {
|
||||
override fun foo() {}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !OPT_IN: kotlin.RequiresOptIn
|
||||
// FILE: api.kt
|
||||
|
||||
|
||||
compiler/testData/diagnostics/testsWithStdLib/experimental/overrideDifferentExperimentalities.fir.kt
Vendored
-38
@@ -1,38 +0,0 @@
|
||||
// !OPT_IN: kotlin.RequiresOptIn
|
||||
|
||||
@RequiresOptIn(level = RequiresOptIn.Level.WARNING)
|
||||
@Retention(AnnotationRetention.BINARY)
|
||||
annotation class E1
|
||||
|
||||
@RequiresOptIn(level = RequiresOptIn.Level.WARNING)
|
||||
@Retention(AnnotationRetention.BINARY)
|
||||
annotation class E3
|
||||
|
||||
interface Base1 {
|
||||
@E1
|
||||
fun foo()
|
||||
}
|
||||
|
||||
interface Base2 {
|
||||
fun foo()
|
||||
}
|
||||
|
||||
interface Base3 {
|
||||
@E3
|
||||
fun foo()
|
||||
}
|
||||
|
||||
class DerivedA : Base1, Base2, Base3 {
|
||||
override fun foo() {}
|
||||
}
|
||||
|
||||
class DerivedB : Base1, Base3 {
|
||||
@E3
|
||||
override fun foo() {}
|
||||
}
|
||||
|
||||
class DerivedC : Base1, Base2, Base3 {
|
||||
@E1
|
||||
@E3
|
||||
override fun foo() {}
|
||||
}
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !OPT_IN: kotlin.RequiresOptIn
|
||||
|
||||
@RequiresOptIn(level = RequiresOptIn.Level.WARNING)
|
||||
|
||||
Reference in New Issue
Block a user