[K2] Disappeared OPT_IN_USAGE_ERROR for a data class property during the destructuring declaration
^KT-62450
This commit is contained in:
committed by
Space Team
parent
dfdd86da1f
commit
9ad4cf4c55
+19
@@ -0,0 +1,19 @@
|
||||
// !OPT_IN: kotlin.RequiresOptIn
|
||||
// FILE: api.kt
|
||||
|
||||
|
||||
// MODULE: A
|
||||
package main
|
||||
|
||||
@kotlin.RequiresOptIn
|
||||
annotation class Marker
|
||||
|
||||
data class DataClass(@property:Marker val x: Int)
|
||||
|
||||
// MODULE: B(A)
|
||||
package main
|
||||
|
||||
fun test(d: DataClass) {
|
||||
val (<!OPT_IN_USAGE_ERROR!>x<!>) = d
|
||||
val c = d.<!OPT_IN_USAGE_ERROR!>component1<!>()
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
// !OPT_IN: kotlin.RequiresOptIn
|
||||
// FILE: api.kt
|
||||
|
||||
|
||||
// MODULE: A
|
||||
package main
|
||||
|
||||
@kotlin.RequiresOptIn
|
||||
annotation class Marker
|
||||
|
||||
data class DataClass(@property:Marker val x: Int)
|
||||
|
||||
// MODULE: B(A)
|
||||
package main
|
||||
|
||||
fun test(d: DataClass) {
|
||||
val (x) = d
|
||||
val c = d.component1()
|
||||
}
|
||||
+1
-1
@@ -27,7 +27,7 @@ data class DataClass(@property:Marker val x: Int)
|
||||
fun useDataClass(d: DataClass) {
|
||||
// Should have error in both
|
||||
d.<!OPT_IN_USAGE_ERROR!>x<!>
|
||||
val (x) = d
|
||||
val (<!OPT_IN_USAGE_ERROR!>x<!>) = d
|
||||
}
|
||||
|
||||
typealias My = <!OPT_IN_USAGE_ERROR!>Some<!>
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ data class DataClass(@property:Marker val x: Int)
|
||||
fun useDataClass(d: DataClass) {
|
||||
// Should have error in both
|
||||
d.<!OPT_IN_USAGE_ERROR!>x<!>
|
||||
val (x) = d
|
||||
val (<!OPT_IN_USAGE_ERROR!>x<!>) = d
|
||||
}
|
||||
|
||||
typealias My = <!OPT_IN_USAGE_ERROR!>Some<!>
|
||||
|
||||
Reference in New Issue
Block a user