For count % 2
I get the warning
Warning:(137, 17) Kotlin: 'mod(Int): Int' is deprecated. Use rem(other) instead
and the Intellij IDE provides for an automated correction to count.rem(2)
which I then get flagged as an error due to an unresolved reference to rem
.
What am I doing wrong?
This is a known bug in the Kotlin IDE plugin.
It arises from the deprecation of the mod
function in Kotlin 1.1, which should be replaced by rem
(see Other changes in this blog post). But the IDE plugin incorrectly reports and suggest the quick fix even for earlier Kotlin versions which didn't have rem
.
Unitl it is fixed, you can either update your project to Kotlin 1.1 or suppress the warnings, or just ignore them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With