name: fix name token constructor
This commit is contained in:
@@ -67,9 +67,12 @@ sealed interface Name : Comparable<Name> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** An individual part of a name string that can be compared intelligently. */
|
/** 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) :
|
internal constructor(internal val collationKey: CollationKey, internal val type: Type) :
|
||||||
Comparable<Token> {
|
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
|
val value: String
|
||||||
get() = collationKey.sourceString
|
get() = collationKey.sourceString
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user