# k2-early-adopters

Andrey Navodnik

11/22/2023, 6:11 AM
Hi everybody, I would like to report a minor problem with Kotlin 2.0.0-beta1. If the following program is copied into editor
Copy code
fun test() {
    suspend fun f(value: Int) {} // Incorrect warning: Redundant 'suspend' modifier
    val executors = mutableListOf<Pair<suspend (Int) -> Unit, Int>> ()
    val executor = Pair(::f, 0)
compiler shows, in my opinion, incorrect warning for function
f(value: Int)
, and that is:
Copy code
Redundant 'suspend' modifier
If the
keyword is deleted, than the program does not compile anymore. The error message is:
Copy code
Type mismatch.
Pair<suspend (Int) → Unit, Int>
Pair<KFunction1<Int, Unit>, Int>
Are my observations/conclusions correct? Any suggestions? For your information, I'm using the following IntelliJ IDEA:
Copy code
IntelliJ IDEA 2023.2.5 (Community Edition)
Build #IC-232.10227.8, built on November 9, 2023
Runtime version: 17.0.9+7-b1000.46 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 3072M
Cores: 8
Kotlin: 232-1.9.0-IJ10227.8
Kind regards, Andrey


11/22/2023, 8:13 AM
Hey It's not the compiler warning but an IDE inspection Please create a YT ticket You can suppress it locally with
or disable globally with settings -> editor -> inspections

Andrey Navodnik

11/22/2023, 8:59 AM
Dmitriy, thank for your answer. As you have suggested, I have created a ticket
👍 3