FIR2IR: add implicit NOT_NULL cast if needed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
eeda48e63e
commit
46cc01602e
@@ -35,6 +35,18 @@ object CompilerConeAttributes {
|
||||
override fun toString(): String = "@NoInfer"
|
||||
}
|
||||
|
||||
object EnhancedNullability : ConeAttribute<EnhancedNullability>() {
|
||||
val ANNOTATION_CLASS_ID = ClassId(FqName("kotlin.jvm.internal"), Name.identifier("EnhancedNullability"))
|
||||
|
||||
override fun union(other: EnhancedNullability?): EnhancedNullability? = other
|
||||
override fun intersect(other: EnhancedNullability?): EnhancedNullability? = this
|
||||
override fun isSubtypeOf(other: EnhancedNullability?): Boolean = true
|
||||
|
||||
override val key: KClass<out EnhancedNullability> = EnhancedNullability::class
|
||||
|
||||
override fun toString(): String = "@EnhancedNullability"
|
||||
}
|
||||
|
||||
object ExtensionFunctionType : ConeAttribute<ExtensionFunctionType>() {
|
||||
val ANNOTATION_CLASS_ID = ClassId(FqName("kotlin"), Name.identifier("ExtensionFunctionType"))
|
||||
|
||||
@@ -62,8 +74,12 @@ object CompilerConeAttributes {
|
||||
|
||||
val ConeAttributes.exact: CompilerConeAttributes.Exact? by ConeAttributes.attributeAccessor<CompilerConeAttributes.Exact>()
|
||||
val ConeAttributes.noInfer: CompilerConeAttributes.NoInfer? by ConeAttributes.attributeAccessor<CompilerConeAttributes.NoInfer>()
|
||||
val ConeAttributes.enhancedNullability: CompilerConeAttributes.EnhancedNullability? by ConeAttributes.attributeAccessor<CompilerConeAttributes.EnhancedNullability>()
|
||||
val ConeAttributes.extensionFunctionType: CompilerConeAttributes.ExtensionFunctionType? by ConeAttributes.attributeAccessor<CompilerConeAttributes.ExtensionFunctionType>()
|
||||
val ConeAttributes.unsafeVarianceType: CompilerConeAttributes.UnsafeVariance? by ConeAttributes.attributeAccessor<CompilerConeAttributes.UnsafeVariance>()
|
||||
|
||||
val ConeKotlinType.hasEnhancedNullability: Boolean
|
||||
get() = attributes.enhancedNullability != null
|
||||
|
||||
val ConeKotlinType.isExtensionFunctionType: Boolean
|
||||
get() = attributes.extensionFunctionType != null
|
||||
|
||||
Reference in New Issue
Block a user