FE 1.0: spread OptIn markers to children except fake override case
#KT-49001 Fixed
This commit is contained in:
committed by
TeamCityServer
parent
3045a5e920
commit
69e06a242a
-89
@@ -1,89 +0,0 @@
|
||||
// !OPT_IN: kotlin.RequiresOptIn
|
||||
// FILE: api.kt
|
||||
|
||||
package api
|
||||
|
||||
@RequiresOptIn(level = RequiresOptIn.Level.WARNING)
|
||||
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
|
||||
@Retention(AnnotationRetention.BINARY)
|
||||
annotation class ExperimentalAPI
|
||||
|
||||
@ExperimentalAPI
|
||||
class C {
|
||||
fun function(): String = ""
|
||||
val property: String = ""
|
||||
class Nested
|
||||
inner class Inner
|
||||
}
|
||||
|
||||
@ExperimentalAPI
|
||||
fun C.extension() {}
|
||||
|
||||
// FILE: usage-propagate.kt
|
||||
|
||||
package usage1
|
||||
|
||||
import api.*
|
||||
|
||||
@ExperimentalAPI
|
||||
fun useAll() {
|
||||
val c: C = C()
|
||||
c.function()
|
||||
c.property
|
||||
C.Nested()
|
||||
c.Inner()
|
||||
c.extension()
|
||||
}
|
||||
|
||||
@ExperimentalAPI
|
||||
class Use {
|
||||
fun useAll(c: C) {
|
||||
c.function()
|
||||
c.property
|
||||
C.Nested()
|
||||
c.Inner()
|
||||
c.extension()
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: usage-use.kt
|
||||
|
||||
package usage2
|
||||
|
||||
import api.*
|
||||
|
||||
@OptIn(ExperimentalAPI::class)
|
||||
fun useAll() {
|
||||
val c: C = C()
|
||||
c.function()
|
||||
c.property
|
||||
C.Nested()
|
||||
c.Inner()
|
||||
c.extension()
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalAPI::class)
|
||||
class Use {
|
||||
fun useAll(c: C) {
|
||||
c.function()
|
||||
c.property
|
||||
C.Nested()
|
||||
c.Inner()
|
||||
c.extension()
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: usage-none.kt
|
||||
|
||||
package usage3
|
||||
|
||||
import api.*
|
||||
|
||||
fun use() {
|
||||
val c: <!OPT_IN_USAGE!>C<!> = <!OPT_IN_USAGE!>C<!>()
|
||||
<!OPT_IN_USAGE!>c<!>.<!OPT_IN_USAGE!>function<!>()
|
||||
<!OPT_IN_USAGE!>c<!>.<!OPT_IN_USAGE!>property<!>
|
||||
<!OPT_IN_USAGE!>C<!>.<!OPT_IN_USAGE!>Nested<!>()
|
||||
<!OPT_IN_USAGE!>c<!>.<!OPT_IN_USAGE!>Inner<!>()
|
||||
<!OPT_IN_USAGE!>c<!>.<!OPT_IN_USAGE!>extension<!>()
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !OPT_IN: kotlin.RequiresOptIn
|
||||
// FILE: api.kt
|
||||
|
||||
@@ -81,9 +82,9 @@ import api.*
|
||||
|
||||
fun use() {
|
||||
val c: <!OPT_IN_USAGE!>C<!> = <!OPT_IN_USAGE!>C<!>()
|
||||
<!OPT_IN_USAGE!>c<!>.function()
|
||||
<!OPT_IN_USAGE!>c<!>.property
|
||||
<!OPT_IN_USAGE!>C<!>.Nested()
|
||||
<!OPT_IN_USAGE!>c<!>.Inner()
|
||||
<!OPT_IN_USAGE!>c<!>.<!OPT_IN_USAGE!>function<!>()
|
||||
<!OPT_IN_USAGE!>c<!>.<!OPT_IN_USAGE!>property<!>
|
||||
<!OPT_IN_USAGE!>C<!>.<!OPT_IN_USAGE!>Nested<!>()
|
||||
<!OPT_IN_USAGE!>c<!>.<!OPT_IN_USAGE!>Inner<!>()
|
||||
<!OPT_IN_USAGE!>c<!>.<!OPT_IN_USAGE!>extension<!>()
|
||||
}
|
||||
|
||||
+2
-2
@@ -52,7 +52,7 @@ package usage3
|
||||
import api.*
|
||||
|
||||
fun use1() {
|
||||
<!OPT_IN_USAGE!>C<!>.D.E.F()
|
||||
<!OPT_IN_USAGE!>C<!>.<!OPT_IN_USAGE!>D<!>.<!OPT_IN_USAGE!>E<!>.<!OPT_IN_USAGE!>F<!>()
|
||||
}
|
||||
|
||||
fun use2(f: <!OPT_IN_USAGE!>C<!>.D.E.F) = f.hashCode()
|
||||
fun use2(f: <!OPT_IN_USAGE!>C<!>.<!OPT_IN_USAGE!>D<!>.<!OPT_IN_USAGE!>E<!>.<!OPT_IN_USAGE!>F<!>) = <!OPT_IN_USAGE!>f<!>.<!OPT_IN_USAGE!>hashCode<!>()
|
||||
|
||||
+1
-1
@@ -84,7 +84,7 @@ object O {
|
||||
operator fun provideDelegate(x: Any?, y: Any?): C = C()
|
||||
}
|
||||
|
||||
val x: String by <!OPT_IN_USAGE_FUTURE_ERROR!>O<!>
|
||||
val x: String by <!OPT_IN_USAGE_ERROR, OPT_IN_USAGE_FUTURE_ERROR!>O<!>
|
||||
|
||||
@Marker
|
||||
class OperatorContainer : Comparable<OperatorContainer> {
|
||||
|
||||
Reference in New Issue
Block a user