[Jspecify] Use enhancement of type with enhancement if possible during substitution

This commit is contained in:
Victor Petukhov
2021-05-12 19:22:56 +03:00
parent 12f6146bdf
commit 21dada4d2d
3 changed files with 9 additions and 9 deletions
@@ -65,7 +65,7 @@ interface NewTypeSubstitutor : TypeSubstitutorMarker {
KotlinTypeFactory.flexibleType(
lowerBound?.lowerIfFlexible() ?: type.lowerBound,
upperBound?.upperIfFlexible() ?: type.upperBound
).wrapEnhancement(enhancement)
).wrapEnhancement(if (enhancement is TypeWithEnhancement) enhancement.enhancement else enhancement)
}
}
}