Skip to content

Commit e6c79bb

Browse files
Godinyanex
authored andcommitted
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.
1 parent e28053c commit e6c79bb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Writerside/topics/KaType.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ type because it may be unknown if this type can accept `null`.
6060
ordinary calls are valid on it.
6161

6262
`fun KaType.upperBoundIfFlexible(): KaType`
63-
: Returns the upper bound if the given type is a flexible type, and `null` otherwise.
63+
: Returns the upper bound if the given type is a flexible type, and the given type itself otherwise.
6464

6565
`fun KaType.lowerBoundIfFlexible(): KaType`
66-
: Returns the lower bound if the given type is a flexible type, and `null` otherwise.
66+
: Returns the lower bound if the given type is a flexible type, and the given type itself otherwise.
6767

6868
## Type relation utilities
6969

0 commit comments

Comments
 (0)