ktor-http-api-sample
ktor-http-api-sample copied to clipboard
IDEA reports an error
When I am copying CustomerRoutes.kt:
delete("{id}") {
val id = call.parameters["id"] ?: return@delete call.respond(HttpStatusCode.BadRequest)
if (customerStorage.removeIf ({ it.id == id }) {
//‘removeIf' unresolved;‘it.id' unresolved
call.respondText("Customer removed correctly", status = HttpStatusCode.Accepted)
} else {
call.respondText("Not Found", status = HttpStatusCode.NotFound)
}
}
into my project my IDE reports an error said: Unresolved reference: removeIf Unresolved reference: id
Could you tell me how to fix? JDK 11.0.7 JRE 1.8.1u251 IntelliJ IDEA Community Edition 2019.2.4 No Ktor plugins installed
Go to File > Project Structure and make sure the JDK you are using is well configured. The procedure in the link helped me to solve also the issue you reported: https://discuss.kotlinlang.org/t/cannot-access-java-io-serializable-which-is-a-supertype-of/16595/4