From e6c79bb13e824c25de0d7d6ae0fb787abd4fca0c Mon Sep 17 00:00:00 2001 From: Evgeny Mandrikov Date: Thu, 5 Dec 2024 17:36:28 +0100 Subject: [PATCH] Fix description of `KaType.upperBoundIfFlexible` and `KaType.lowerBoundIfFlexible` According to https://github.com/JetBrains/kotlin/blob/2.1.0/analysis/analysis-api/src/org/jetbrains/kotlin/analysis/api/components/KaTypeProvider.kt#L106-L112 ``` public fun KaType.upperBoundIfFlexible(): KaType = withValidityAssertion { (this as? KaFlexibleType)?.upperBound ?: this } public fun KaType.lowerBoundIfFlexible(): KaType = withValidityAssertion { (this as? KaFlexibleType)?.lowerBound ?: this } ``` instead of `null` they return the given type itself. --- Writerside/topics/KaType.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Writerside/topics/KaType.md b/Writerside/topics/KaType.md index 57bc077..a15a123 100644 --- a/Writerside/topics/KaType.md +++ b/Writerside/topics/KaType.md @@ -60,10 +60,10 @@ type because it may be unknown if this type can accept `null`. ordinary calls are valid on it. `fun KaType.upperBoundIfFlexible(): KaType` -: Returns the upper bound if the given type is a flexible type, and `null` otherwise. +: Returns the upper bound if the given type is a flexible type, and the given type itself otherwise. `fun KaType.lowerBoundIfFlexible(): KaType` -: Returns the lower bound if the given type is a flexible type, and `null` otherwise. +: Returns the lower bound if the given type is a flexible type, and the given type itself otherwise. ## Type relation utilities