I have converted java file to kotlin using android studio inbuilt file converter. It show below error.
[SMARTCAST_IMPOSSIBLE] Smart cast to 'ReminderRequester' is impossible, because 'ReminderRequester' is a mutable property that could have been changed by this time
My code snippet is as below.
private var sReminderInstance: ReminderRequester? = null
val instance: ReminderRequester
get() {
if (sReminderInstance == null) {
sReminderInstance = ReminderRequester()
}
return sReminderInstance; // ERROR: Smart cast to 'ReminderRequester' is impossible, because 'ReminderRequester' is a mutable property that could have been changed by this time
}
I have checked similar type of question but I can not able to understand it properly.
What is meaning of above error and how to fix it?