I've recently upgraded a project from kotlin 1.3.7...
# announcements
n
I've recently upgraded a project from kotlin 1.3.72 to 1.4.10. Suddenly I am experiencing error of the following kind:
Copy code
val deviceMap = mutableMapOf(
                "organisationId" to authenticationData.organisationId,
                "userId" to authenticationData.userId,
                "deviceTemplateUuid" to AuthenticationService.DeviceTemplate.findById(authenticationData.deviceTemplateId).clientId,
                "dateInstalled" to dateInstalled
        ).also {
            it.putAll(extraProps)
        }
The variable "extraProp" is defined as Map<String, Any>. In the past, I'm certain kotlin would have interpreted the return from "mutableMapOf" as MutableMap<String, Any>, but now I'm suddenly getting the following compiler error: Kotlin: Type mismatch: inferred type is Map<String, Any> but Map<out String, {Comparable<{Instant & String & UUID}> & java.io.Serializable}> was expected Is it mandatory now that I give a type hint to the function as "mutableMapOf<String,Any>(...)" to avoid this Union type nightmare?
k
It's not a union type, it's an intersection type. But a nightmare anyway as no object could ever have that type in java.