https://kotlinlang.org logo
#stdlib
Title
# stdlib
d

diesieben07

03/08/2018, 11:16 PM
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

ilya.gorbunov

03/08/2018, 11:19 PM
You need to have API version at least 1.2 to use api from this library
d

diesieben07

03/08/2018, 11:20 PM
What is "API version", exactly?
d

diesieben07

03/08/2018, 11:21 PM
Okay. So, 1.2 is not the default then?
i

ilya.gorbunov

03/08/2018, 11:21 PM
Usually it's inferred automatically from the version of the standard library when you import your project in IDEA
d

diesieben07

03/08/2018, 11:21 PM
Well, it is not for me. I created this project using the new project wizard
i

ilya.gorbunov

03/08/2018, 11:23 PM
Please check the value of API version in Project structure -> Modules -> your module -> Kotlin facet
d

diesieben07

03/08/2018, 11:23 PM
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

ilya.gorbunov

03/08/2018, 11:25 PM
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

diesieben07

03/08/2018, 11:27 PM
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

ilya.gorbunov

03/08/2018, 11:27 PM
That's known one: https://youtrack.jetbrains.com/issue/KT-20672 I hope it will be fixed soon
d

diesieben07

03/08/2018, 11:28 PM
Ah, cool, thank you!
Teaches me to trust ctrl-space so much 🙃
3 Views