FIR Java: use definitely not-null types for type parameters

We support & use ConeDefinitelyNotNullType more properly here
This commit is contained in:
Mikhail Glukhikh
2019-11-12 11:51:16 +03:00
parent 63f38bb28a
commit bd70daa3d1
13 changed files with 94 additions and 13 deletions
@@ -168,11 +168,18 @@ class ConeTypeVariableType(
override val typeArguments: Array<out ConeKotlinTypeProjection> get() = emptyArray()
}
class ConeDefinitelyNotNullType(val original: ConeKotlinType): ConeKotlinType(), DefinitelyNotNullTypeMarker {
class ConeDefinitelyNotNullType private constructor(val original: ConeKotlinType) : ConeKotlinType(), DefinitelyNotNullTypeMarker {
override val typeArguments: Array<out ConeKotlinTypeProjection>
get() = original.typeArguments
override val nullability: ConeNullability
get() = ConeNullability.NOT_NULL
companion object {
fun create(original: ConeKotlinType): ConeDefinitelyNotNullType {
if (original is ConeFlexibleType) return create(original.lowerBound)
return ConeDefinitelyNotNullType(original)
}
}
}
/*