From d50ab103ff0cfb8dfa6169d5f11de62900137b59 Mon Sep 17 00:00:00 2001 From: Travis Wyatt Date: Fri, 12 Jan 2024 14:15:57 -0800 Subject: [PATCH] Mark `Registration` sub types as `data object`s Improves `toString` output, especially on JS, which currently translates to `[object Object]` (rather than `Register` or `Deregister`). --- koap/src/commonMain/kotlin/Message.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/koap/src/commonMain/kotlin/Message.kt b/koap/src/commonMain/kotlin/Message.kt index 551027b5..41e909fc 100644 --- a/koap/src/commonMain/kotlin/Message.kt +++ b/koap/src/commonMain/kotlin/Message.kt @@ -303,8 +303,8 @@ sealed class Message { * - `1` (deregister) removes the entry from the list, if present. */ sealed class Registration { - object Register : Registration() - object Deregister : Registration() + data object Register : Registration() + data object Deregister : Registration() } /**