[AA] Fix write access configuration in unit test application environments
- We cannot configure the application's write action accessibility on a per-test basis because (1) the application may be shared across concurrent tests and (2) the application is usually cached, so the configuration will be missed entirely. - There is actually a much easier solution to allow write access selectively: We can enable it in `runWriteAction` blocks, and keep it in a thread local to support concurrent test runs. As Analysis API tests never call `runWriteAction`, there will be no "analyze cannot be called from a write action" error, and if `analyze` is somehow called from a write action, it will now be caught. ^KT-63560 fixed
This commit is contained in:
committed by
Space Team
parent
3b7f43a9c2
commit
1870189e47
-3
@@ -1,6 +1,3 @@
|
||||
// IGNORE_FIR
|
||||
// Reason: KT-63560
|
||||
|
||||
import kotlin.contracts.contract
|
||||
import kotlin.contracts.InvocationKind
|
||||
|
||||
|
||||
-3
@@ -1,6 +1,3 @@
|
||||
// IGNORE_FIR
|
||||
// Reason: KT-63560
|
||||
|
||||
fun foo(string: String) {
|
||||
<expr>println("Hello world, $string!")</expr>
|
||||
}
|
||||
|
||||
-3
@@ -1,6 +1,3 @@
|
||||
// IGNORE_FIR
|
||||
// Reason: KT-63560
|
||||
|
||||
fun foo(string: String) {
|
||||
val a = 7
|
||||
<expr>println("Hello world, $string!")</expr>
|
||||
|
||||
-3
@@ -1,6 +1,3 @@
|
||||
// IGNORE_FIR
|
||||
// Reason: KT-63560
|
||||
|
||||
import kotlin.contracts.InvocationKind
|
||||
|
||||
inline fun foo(block: () -> Unit) {
|
||||
|
||||
-3
@@ -1,6 +1,3 @@
|
||||
// IGNORE_FIR
|
||||
// Reason: KT-63560
|
||||
|
||||
fun foo(string: String) {
|
||||
<expr>string.length</expr>
|
||||
}
|
||||
|
||||
-3
@@ -1,6 +1,3 @@
|
||||
// IGNORE_FIR
|
||||
// Reason: KT-63560
|
||||
|
||||
fun foo(string: String) {
|
||||
println()
|
||||
<expr>string.length</expr>
|
||||
|
||||
-3
@@ -1,4 +1 @@
|
||||
// IGNORE_FIR
|
||||
// Reason: KT-63560
|
||||
|
||||
<expr>val property: Int = 5</expr>
|
||||
|
||||
Reference in New Issue
Block a user