I am currently migrating my Android application to kotlin 2.0.0
this code used to compile fine
myConfig?.myFramerate = myFramerate!!.toInt()
myConfig?.myFramerate = myFramerate.toInt()
Following migration to kotlin 2.0.0 however the second line now fails with
Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type 'kotlin.String?'.
to resolve the compile time error I add !! as shown here on the second line
myConfig?.myFramerate = myFramerate!!.toInt()
myConfig?.myFramerate = myFramerate!!.toInt()
however I then get this android studio message
Unnecessary non-null assertion (!!) on a non-null receiver of type String
is there something i am missing when migrating to Kotlin 2.0.0?