[FIR] Apply withNullability to attributes with cone types
#KT-56989
This commit is contained in:
committed by
Space Team
parent
7910e8ad24
commit
ef96912573
@@ -259,7 +259,8 @@ fun <T : ConeKotlinType> T.withNullability(
|
|||||||
preserveEnhancedNullability: Boolean = false,
|
preserveEnhancedNullability: Boolean = false,
|
||||||
): T {
|
): T {
|
||||||
val theAttributes = attributes.butIf(!preserveEnhancedNullability) {
|
val theAttributes = attributes.butIf(!preserveEnhancedNullability) {
|
||||||
it.remove(CompilerConeAttributes.EnhancedNullability)
|
val withoutEnhanced = it.remove(CompilerConeAttributes.EnhancedNullability)
|
||||||
|
withoutEnhanced.transformTypesWith { t -> t.withNullability(nullability, typeContext) } ?: withoutEnhanced
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.nullability == nullability && this.attributes == theAttributes) {
|
if (this.nullability == nullability && this.attributes == theAttributes) {
|
||||||
|
|||||||
Reference in New Issue
Block a user