title: None of the following candidates is applicable because of receiver type mismatch
body: <p>I am doing the migration of an old Android Codebase.  I am getting the below error for the mentioned code. What could be the reason for the issue? How can we solve it easily?</p>
  <pre><code>    fun action(action: FunAction) = actor.offer(action)
  
      private val actor = actor&lt;FunAction&gt;(Dispatchers.Main, Channel.CONFLATED) {
  
          for (action in this) when (action) {
  
              is FunAction.Init -&gt; { }
  
              is FunAction.SaveUserSetting -&gt; { }
  
              is FunAction.UploadProfilePhoto -&gt; { }
  
      }
  
  </code></pre>
  <pre><code>Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: 
  
  public fun &lt;E&gt; CoroutineScope.actor(context: CoroutineContext = ..., capacity: Int = ..., 
  start: CoroutineStart = ..., onCompletion: CompletionHandler? /* = ((cause: Throwable?) -&gt; Unit)? */ = ...,
  block: suspend ActorScope&lt;TypeVariable(E)&gt;.() -&gt; Unit): SendChannel&lt;TypeVariable(E)&gt; 
  defined in kotlinx.coroutines.channels
  
  
  </code></pre>