Thread
#stdlib
    d

    diesieben07

    4 years ago
    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
    ?
    ilya.gorbunov

    ilya.gorbunov

    4 years ago
    You need to have API version at least 1.2 to use api from this library
    d

    diesieben07

    4 years ago
    What is "API version", exactly?
    d

    diesieben07

    4 years ago
    Okay. So, 1.2 is not the default then?
    ilya.gorbunov

    ilya.gorbunov

    4 years ago
    Usually it's inferred automatically from the version of the standard library when you import your project in IDEA
    d

    diesieben07

    4 years ago
    Well, it is not for me. I created this project using the new project wizard
    ilya.gorbunov

    ilya.gorbunov

    4 years ago
    Please check the value of API version in Project structure -> Modules -> your module -> Kotlin facet
    d

    diesieben07

    4 years ago
    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
    ilya.gorbunov

    ilya.gorbunov

    4 years ago
    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

    4 years ago
    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
    ilya.gorbunov

    ilya.gorbunov

    4 years ago
    That's known one: https://youtrack.jetbrains.com/issue/KT-20672 I hope it will be fixed soon
    d

    diesieben07

    4 years ago
    Ah, cool, thank you!
    Teaches me to trust ctrl-space so much 🙃