Using `org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.2...
# stdlib
d
Using
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.2.30
I cannot use
use
on
AutoCloseable
, is that correct? How can I "use" an
AutoCloseable
?
i
You need to have API version at least 1.2 to use api from this library
d
What is "API version", exactly?
d
Okay. So, 1.2 is not the default then?
i
Usually it's inferred automatically from the version of the standard library when you import your project in IDEA
d
Well, it is not for me. I created this project using the new project wizard
i
Please check the value of API version in Project structure -> Modules -> your module -> Kotlin facet
d
Adding it to my build.gradle helped, thank you. However now ctrl-clicking on the
use
call yields "Cannot find declaration to go to", which is probably something for #intellij
i
You don't have to add it manually to the build file, if it's the same as the version of the standard library. If your experience differ, please report a bug.
d
Okay, the issue seems to be different than I thought. I do not need to add it manually in the build file. Only IntelliJ seems to be only "half aware" of this function. It is not highlighted as an error, but it's not auto-completed and you cannot goto declaration on it. I'll report a bug for that if i cant find an existing one
i
That's known one: https://youtrack.jetbrains.com/issue/KT-20672 I hope it will be fixed soon
d
Ah, cool, thank you!
Teaches me to trust ctrl-space so much 🙃