[FIR] Introduce OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE diagnostic

^KT-60892
This commit is contained in:
Ivan Kochurkin
2023-08-08 16:00:08 +02:00
committed by Space Team
parent 9ec7218af6
commit 8e8de513ee
22 changed files with 77 additions and 33 deletions
@@ -4,6 +4,7 @@
// WITH_STDLIB
// MODULE: common
// TARGET_PLATFORM: Common
// FILE: expected.kt
package a
@@ -24,17 +25,24 @@ package a
actual annotation class A(actual val x: Int)
// MODULE: main(library)
// MODULE: common2
// TARGET_PLATFORM: Common
// FILE: common2.kt
package usage
import a.B
@B("OK")
@B.C(true)
fun ok() = "OK"
// MODULE: main(library)()(common2)
// FILE: main.kt
package usage
import a.A
import a.B
@A(42)
@B("OK")
@B.C(true)
fun box(): String {
return "OK"
}
fun box(): String = ok()
@@ -18,7 +18,7 @@ expect annotation class WithoutActual(val s: String)
expect fun k(): String
// MODULE: platform()()(common)
// MODULE: lib()()(common)
// FILE: lib.kt
actual class C {
@@ -29,9 +29,15 @@ actual annotation class WithActual(actual val x: Int)
actual fun k() = "K"
// MODULE: main(platform)
// MODULE: common2
// TARGET_PLATFORM: Common
// FILE: common2.kt
@WithoutActual("OK")
fun ok() = C().o() + k()
// MODULE: main(lib)()(common2)
// FILE: main.kt
@WithActual(42)
@WithoutActual("OK")
fun box() = C().o() + k()
fun box() = ok()