Spot the bug in the mutable data-class key

from Data classes
Kotlin 2.4.10 intermediate 4 min 1 issue to find

This key must remain retrievable after insertion. Find the bug.

kotlin
data class AccountKey(var email: String)

fun main() {
    val key = AccountKey("[email protected]")
    val owners = mutableMapOf(key to "Ada")

    key.email = "[email protected]"
    println(owners[key])
}
Open in playground
Report an error