Skip to content

Commit

Permalink
Fix description of KaType.upperBoundIfFlexible and `KaType.lowerBou…
Browse files Browse the repository at this point in the history
…ndIfFlexible`

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.
  • Loading branch information
Godin authored and yanex committed Feb 13, 2025
1 parent e28053c commit e6c79bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Writerside/topics/KaType.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit e6c79bb

Please sign in to comment.