name: fix name token constructor
This commit is contained in:
parent
ac1c31cacb
commit
11a4d6a720
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue