czuckie
05/01/2023, 10:10 AMval someMap: Map<EnumClass, String>
someMap[EnumClass.Value] = "boop"
console.log("${someMap[EnumClassValue]} ${someMap[someMap.keys.first()]}") // Prints "null boop"
associate
function on a collection of items though. I'm going to try this small example though just to see if I get the same result (because that's what I should have done already, d'oh!)@Test
fun canCreateMapWithEnumValue() {
val someMap: MutableMap<EnumClass, String> = mutableMapOf()
someMap[EnumClass.Value] = "boop"
val output = "${someMap[EnumClass.Value]} ${someMap[someMap.keys.first()]}"
assertEquals("boop boop", output)
}
I must be doing something stupidCLOVIS
05/02/2023, 8:02 AM