Fix KT-47708 in FIR by transferring SAM annotations to synthetic constr.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
// FIR_DUMP
|
||||
@RequiresOptIn
|
||||
annotation class ExperimentalKotlinAnnotation
|
||||
|
||||
internal fun interface StableInterface {
|
||||
@ExperimentalKotlinAnnotation // @ExperimentalStdlibApi
|
||||
fun experimentalMethod()
|
||||
}
|
||||
|
||||
fun regressionTestOverrides() {
|
||||
val anonymous: StableInterface = object : StableInterface {
|
||||
override fun <!OPT_IN_OVERRIDE_ERROR!>experimentalMethod<!>() {} // correctly fails check
|
||||
}
|
||||
val lambda = <!OPT_IN_USAGE_ERROR!>StableInterface<!> {} // this does not get flagged
|
||||
}
|
||||
|
||||
@ExperimentalKotlinAnnotation
|
||||
fun suppressed() {
|
||||
val lambda = StableInterface {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user