Since upgrading to Kotlin 1.4.0, I can't seem to u...
# announcements
c
Since upgrading to Kotlin 1.4.0, I can't seem to use String.toBoolean() anymore. I always get the deprecation warning:
toBoolean(): Boolean' is deprecated. Use Kotlin compiler 1.4 to avoid deprecation warning.
It seems like this is not a well-functioning deprecation warning. There's no easy way to select the String?.toBoolean() version instead. Even if I cast to String?, the 1.4 compiler won't let me call String?.toBoolean() explicitly. It seems like a compiler bug.
l
Have you cleaned the build?
m
@colintheshots Hello! Failed to reproduce the problem. Could you please share code example and screenshots?
c
I did try cleaning the build. I'll see what I can come up with.
d
@colintheshots Did you find a way of fix your issue? I got it on a project (but on
ByteArray.contenxtEquals
). I try to reproduce without luck on a sample project. Even though IntelliJ 2020.2 mark the method as deprecated, gradle compile it with success without warnings.
i
@dwursteisen Can it be the case that you still have 1.3.x Kotlin plugin installed in IDEA?
d
🤦‍♂️Totally that. Good catch.
c
Yeah, when I first asked, the 1.4.x Kotlin plugin wasn't even available yet to pair with the other Kotlin 1.4.x libraries.
d
FYI, and to give a lead to people which might have the same issue: We having the issue in our project: despite using Kotlin 1.4, because gradle is trying to start a compiler daemon with Kotlin 1.3.70 (saw by running gradle with
--debug
and checking how it is invoking the kotlin compiler daemon. So the message is super obvious when you understand that you’re compiling with Kotlin 1.3 and not with Kotlin 1.4… Now, I need to find why Gradle is picking the 1.3.70 but it’s should be a configuration issue on our side.