I have cast this code to mutable list. But for some reason it still indicate it as a list. This is my code
return (stringToArray(userSharedPrefs.getString(MY_KEY, null))?.toMutableList()?.distinct()?.reversed() ?: mutableListOf<String>())
But got this error
Type mismatch.
Required:
MutableList<String>
Found:
List<String>
Why it says Found: List<String>