Skip to content

Commit

Permalink
Fix SmithyAst.Boolean node value hash code/equality.
Browse files Browse the repository at this point in the history
  • Loading branch information
iancaffey committed Nov 20, 2023
1 parent 5b1207d commit 23bc19c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/main/kotlin/software/amazon/smithy/intellij/SmithyAst.kt
Original file line number Diff line number Diff line change
@@ -324,17 +324,16 @@ data class SmithyAst(
override fun toString() = values.toString()
}

sealed class Boolean(@JsonValue val value: kotlin.Boolean) : Value {
enum class Boolean(@JsonValue val value: kotlin.Boolean) : Value {
TRUE(true), FALSE(false);

companion object {
operator fun invoke(value: kotlin.Boolean) = if (value) True else False
operator fun invoke(value: kotlin.Boolean) = if (value) TRUE else FALSE
}

override fun toString() = value.toString()
}

object True : Boolean(true)
object False : Boolean(true)

@JsonSerialize(using = Null.Serializer::class)
object Null : Value {
override fun toString() = "null"

0 comments on commit 23bc19c

Please sign in to comment.