From 6edb76990572bfb895fcd5363df689f5790baffe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?To=CF=80?= Date: Sun, 3 Dec 2023 21:27:45 +0100 Subject: [PATCH] fix Omissible#isOmitted and Omissible#isPresent not working for nullable types --- .../kotlin/dev/arbjerg/lavalink/protocol/v4/omissible.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protocol/src/commonMain/kotlin/dev/arbjerg/lavalink/protocol/v4/omissible.kt b/protocol/src/commonMain/kotlin/dev/arbjerg/lavalink/protocol/v4/omissible.kt index a9fbb1aaf..6da7cd5b7 100644 --- a/protocol/src/commonMain/kotlin/dev/arbjerg/lavalink/protocol/v4/omissible.kt +++ b/protocol/src/commonMain/kotlin/dev/arbjerg/lavalink/protocol/v4/omissible.kt @@ -73,7 +73,7 @@ class OmissableSerializer(private val childSerializer: KSerializer) : KSer } @OptIn(ExperimentalContracts::class) -fun Omissible.isPresent(): Boolean { +fun Omissible.isPresent(): Boolean { contract { returns(true) implies (this@isPresent is Omissible.Present) } @@ -81,7 +81,7 @@ fun Omissible.isPresent(): Boolean { } @OptIn(ExperimentalContracts::class) -fun Omissible.isOmitted(): Boolean { +fun Omissible.isOmitted(): Boolean { contract { returns(true) implies (this@isOmitted is Omissible.Omitted) }