I've been getting a warning for the following code...
# coroutines
e
I've been getting a warning for the following code. The warning is:
Non-applicable call for builder inference
and it occurs on the line that starts with
channel.send
Copy code
override val animationProgressChannel: ReceiveChannel<Float> = resumeScope.produce {
    lottieAnimation.addAnimatorUpdateListener { animation ->
      resumeScope.launch {
        channel.send(animation.animatedValue as Float) // Non-applicable call for builder inference (channel is highlighted)
      }
    }
  }
If I change it to
resumeScope.produce<Float>
the warning goes away, but the IDE suggests that I "remove the explicit type arguments". Anyone know what's up with that?
r
you should post the warning
g
remove the explicit type arguments
Is not a warning, just a suggestion from IDE that you can remove explicit type because it inferred already from return type of the function
e
The warning is in the comment next to the expression (
channel.send...
). I'll highlight it as well
l
You should report it on kotl.in/issue with a screenshot for each of the 2 cases (and link it here).
g
Yeah, it also may be a problem of new type inference enabled now by default for Kotlin Idea plugin
r
I like that the only Google Search result for that warning is the code where it's defined: https://www.google.com/search?q="Non-applicable+call+for+builder+inference"
😁 1
e