In all of my kotlin projects, I have found new warnings involving what use to be platform types. For example
val s: String = sharedPrefs.getString("key", "defaultValue")
produces a warning
Type mismatch: inferred type is String? but String was expected
It compiles fine though so it seems to be unrelated to kotlins enforcing nullable type. But this warning seems to have popped up in the recent weeks which may be related to a change in android studio or the kotlin plugin.
In this specific case, why doesn't the inferred type match what I provided in the 2nd argument (a String not a String?)