[FIR] Introduce OPTIONAL_DECLARATION_USAGE_IN_NON_COMMON_SOURCE diagnostic
^KT-60892
This commit is contained in:
committed by
Space Team
parent
9ec7218af6
commit
8e8de513ee
+15
-7
@@ -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()
|
||||
|
||||
Vendored
+10
-4
@@ -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()
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
// WITH_STDLIB
|
||||
// IGNORE_BACKEND: JS
|
||||
// IGNORE_BACKEND_K1: WASM, JS_IR, JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6, WASM
|
||||
// !API_VERSION: 1.9
|
||||
|
||||
import kotlin.concurrent.*
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
// WITH_STDLIB
|
||||
// IGNORE_BACKEND: JS
|
||||
// IGNORE_BACKEND_K1: WASM, JS_IR, JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6, WASM
|
||||
// !API_VERSION: 1.9
|
||||
|
||||
import kotlin.concurrent.*
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// WITH_STDLIB
|
||||
// IGNORE_BACKEND: JS
|
||||
// IGNORE_BACKEND_K1: WASM, JS_IR, JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6, WASM
|
||||
// !API_VERSION: 1.9
|
||||
|
||||
import kotlin.concurrent.*
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
// WITH_STDLIB
|
||||
// IGNORE_BACKEND: JS
|
||||
// IGNORE_BACKEND_K1: WASM, JS_IR, JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6, WASM
|
||||
// !API_VERSION: 1.9
|
||||
|
||||
import kotlin.concurrent.*
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// WITH_STDLIB
|
||||
// IGNORE_BACKEND: JS
|
||||
// IGNORE_BACKEND_K1: WASM, JS_IR, JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6, WASM
|
||||
// !API_VERSION: 1.9
|
||||
|
||||
import kotlin.concurrent.*
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
// WITH_STDLIB
|
||||
// IGNORE_BACKEND: JS
|
||||
// IGNORE_BACKEND_K1: WASM, JS_IR, JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6, WASM
|
||||
// !API_VERSION: 1.9
|
||||
|
||||
import kotlin.concurrent.*
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
// WITH_STDLIB
|
||||
// IGNORE_BACKEND: JS
|
||||
// IGNORE_BACKEND_K1: WASM, JS_IR, JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6, WASM
|
||||
// !API_VERSION: 1.9
|
||||
|
||||
import kotlin.concurrent.*
|
||||
|
||||
+1
-2
@@ -1,6 +1,5 @@
|
||||
// WITH_STDLIB
|
||||
// IGNORE_BACKEND: JS
|
||||
// IGNORE_BACKEND_K1: WASM, JS_IR, JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6, WASM
|
||||
// !API_VERSION: 1.9
|
||||
|
||||
import kotlin.concurrent.*
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// WITH_STDLIB
|
||||
// IGNORE_BACKEND: JS
|
||||
// IGNORE_BACKEND_K1: WASM, JS_IR, JS_IR_ES6
|
||||
// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6, WASM
|
||||
// !API_VERSION: 1.9
|
||||
|
||||
import kotlin.concurrent.*
|
||||
|
||||
Reference in New Issue
Block a user