KTIJ-30581 [kotlin] Adjust refactorings and J2K testdata to the new Import Optimizer implementation

There are some improvements and some degradations.

Most notably, there is a "kotlin.concurrent.Volatile"
annotation replacement in J2K, which happens because
K2 references have problems with type aliases
(see KTIJ-25346 as one of the tracking issues).

GitOrigin-RevId: 8bf9a6a65d34fc335897e8209d09dedf350abc6c
This commit is contained in:
Roman Golyshev
2024-07-24 21:29:26 +02:00
committed by intellij-monorepo-bot
parent 85183ddedc
commit 2b6f294f4a
8 changed files with 16 additions and 30 deletions

View File

@@ -1,18 +0,0 @@
package b
import b.Factory.Companion.invoke
import java.util.function.IntPredicate
interface Factory {
operator fun invoke(i: Int): IntPredicate
companion object {
inline operator fun invoke(crossinline f: (Int) -> IntPredicate) = object : Factory {
override fun invoke(i: Int) = f(i)
}
}
}
fun foo(): Factory = Factory { k ->
IntPredicate { n -> n % k == 0 }
}

View File

@@ -0,0 +1,9 @@
package p
// comment
// comment 2
internal class A {
@Volatile
var field: Int = 0
}

View File

@@ -0,0 +1,6 @@
// API_VERSION: 1.9
// COMPILER_ARGUMENTS: -opt-in=kotlin.ExperimentalStdlibApi
internal class A {
@Volatile
var field1: Int = 0
}

View File

@@ -1,6 +1,4 @@
// ERROR: This annotation is not applicable to target 'member property with backing field'.
import kotlin.concurrent.Volatile
internal class A {
@Deprecated("")
@Volatile

View File

@@ -1,6 +0,0 @@
import TestInnerClasses.Base
class TestInnerClasses {
open inner class Base
inner class Derived : Base()
}

View File

@@ -1,5 +1,5 @@
// ERROR: This annotation is not applicable to target 'member property with backing field'.
import kotlin.concurrent.Volatile
internal class A {
@Deprecated("")