NI: Add flexible Nothing to trivial constraints to filter it

This commit is contained in:
victor.petukhov
2019-12-11 16:56:12 +03:00
parent 2d5a05466d
commit 71cb65c064
7 changed files with 31 additions and 2 deletions
@@ -248,6 +248,9 @@ interface TypeSystemContext : TypeSystemOptimizationContext {
fun KotlinTypeMarker.isNullableAny() = this.typeConstructor().isAnyConstructor() && this.isNullableType()
fun KotlinTypeMarker.isNothing() = this.typeConstructor().isNothingConstructor() && !this.isNullableType()
fun KotlinTypeMarker.isFlexibleNothing() =
this is FlexibleTypeMarker && lowerBound().isNothing() && upperBound().isNullableNothing()
fun KotlinTypeMarker.isNullableNothing() = this.typeConstructor().isNothingConstructor() && this.isNullableType()
fun SimpleTypeMarker.isClassType(): Boolean = typeConstructor().isClassTypeConstructor()