val profilesModel: Map<Profile, String>
var Config.custom: Profile?
val profiles: List<Profile>
get() = Config.custom.let {
// if 'it' is null, the else branch will never be executed, so '!!' should be inferred
if (it?.isSaved ?: true) profilesModel.keys else profilesModel.keys.plus(it!!)
}.sorted() // If '!!' is ommitted, gives a type inference error: receiver type is Set<Profile?>
Or am I missing something and the compiler is just smarter than I am?