name: fix name token constructor

This commit is contained in:
Alexander Capehart 2024-12-16 19:07:50 -05:00
parent ac1c31cacb
commit 11a4d6a720
No known key found for this signature in database
GPG key ID: 37DBE3621FE9AD47

View file

@ -67,9 +67,12 @@ sealed interface Name : Comparable<Name> {
}
/** An individual part of a name string that can be compared intelligently. */
data class Token
class Token
internal constructor(internal val collationKey: CollationKey, internal val type: Type) :
Comparable<Token> {
override fun equals(other: Any?) =
other is Token && collationKey == other.collationKey && type == other.type
override fun hashCode() = 31 * collationKey.hashCode() + type.hashCode()
val value: String
get() = collationKey.sourceString