Skip to content
This repository has been archived by the owner on Apr 11, 2022. It is now read-only.

IDEA reports an error #2

Open
ghost opened this issue May 27, 2020 · 1 comment
Open

IDEA reports an error #2

ghost opened this issue May 27, 2020 · 1 comment

Comments

@ghost
Copy link

ghost commented May 27, 2020

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

@antosport82
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant