title: Is Kotlin Flow's Collect is only internal kotlinx.coroutines API?
body: <p>Taking the direct example from <a href="https://kotlinlang.org/docs/reference/coroutines/flow.html#flows-are-cold" rel="noreferrer">https://kotlinlang.org/docs/reference/coroutines/flow.html#flows-are-cold</a></p>
  <pre><code>fun simple(): Flow&lt;Int&gt; = flow { 
      println(&quot;Flow started&quot;)
      for (i in 1..3) {
          delay(100)
          emit(i)
      }
  }
  
  fun main() = runBlocking&lt;Unit&gt; {
      println(&quot;Calling simple function...&quot;)
      val flow = simple()
      println(&quot;Calling collect...&quot;)
      flow.collect { value -&gt; println(value) } 
      println(&quot;Calling collect again...&quot;)
      flow.collect { value -&gt; println(value) } 
  }
  </code></pre>
  <p>I got the error on <code>collect</code>.</p>
  <pre><code>This is an internal kotlinx.coroutines API that should not be used from outside of kotlinx.coroutines. No compatibility guarantees are provided.It is recommended to report your use-case of internal API to kotlinx.coroutines issue tracker, so stable API could be provided instead
  </code></pre>
  <p>When I add <code>@InternalCoroutinesApi</code></p>
  <pre><code>@InternalCoroutinesApi
  fun main() = runBlocking&lt;Unit&gt; {
      println(&quot;Calling simple function...&quot;)
      val flow = simple()
      println(&quot;Calling collect...&quot;)
      flow.collect { value -&gt; println(value) }
      println(&quot;Calling collect again...&quot;)
      flow.collect { value -&gt; println(value) }
  }
  </code></pre>
  <p>I get an error in the <code>collect</code>'s lambda (function of <code>value -&gt; println(value</code>) as below</p>
  <pre><code>Type mismatch.
  Required:
  FlowCollector&lt;Int&gt;
  Found:
  ([ERROR :  ]) → Unit
  Cannot infer a type for this parameter. Please specify it explicitly.
  </code></pre>
  <p>I am using Kotlin version 1.4.21.</p>
  <pre><code>    implementation &quot;org.jetbrains.kotlin:kotlin-stdlib:1.4.2&quot;
      implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2'
      implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.1'
      testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.4.2'
  </code></pre>
  <p>Did I do anything wrong that I cannot compile the example code in Android Studio?</p>