"Launch" Unresloved reference..?


#1

I’m just using the Intellij IDE. No Gradle or Maven file…

I’m just trying to experiment with coroutines, but something isn’t setup correctly and I can’t seem to fix it.

The code :

import kotlin.coroutines.experimental.*

fun main(args : Array<String>) {
    launch {
        println("something neato")
    }
}

About as simple as it gets. But it won’t compile. I get the following error

Information:Kotlin: kotlinc-jvm 1.2.71 (JRE 10.0.1+10)
Information:9/30/18 4:23 PM - Compilation completed with 1 error and 0 warnings in 1 s 313 ms
/home/jonross/tinker/kotEuler/src/main/euler/async_await_example.kt
Error:(6, 5) Kotlin: Unresolved reference: launch

The compiler in the IDE is set to allow expirmental w/ warnings.

So… what’s the magic missing thing?

Thanks in advance.


#2

Didn’t include/download kotlinx.coroutines.experimental.

please delete.


#3

If anyone wonders how to setup a kotlinx.coroutines dependency in an IntelliJ project, here’s the instruction:
Stackoverflow: Using kotlinx.coroutines in IntelliJ IDEA project