Hi
@Roman Golyshev, thanks for the reply, here's the info:
> Please share your IDEA version
IntelliJ IDEA 2024.3 (Ultimate Edition)
Build #IU-243.21565.193, built on November 13, 2024
> A small reproducer would be really appreciated š
Turns out it's pretty simple to reproduce:
import io.ktor.resources.*
import io.ktor.server.resources.*
import io.ktor.server.routing.*
@Resource("/test")
class TestResource
fun Route.testRouting() {
post<TestResource> {
TODO()
}
}
Error:
Debug.kt:9:5 Overload resolution ambiguity between candidates:
fun <reified T : Any> Route.post(noinline body: suspend RoutingContext.(T) -> Unit): Route
fun <reified R : Any> Route.post(crossinline body: suspend RoutingContext.(R) -> Unit): Route
Adding
import io.ktor.server.resources.post
to that code fixes the error, but K2 will remove that import, while K1 keeps it there.
PS: Tested in kotlin 2.1 and 2.0