Skip to content

Commit ab248e6

Browse files
BlaBlaHumanSpace Team
authored andcommitted
[Analysis API] Enhance warning nullability annotated type arguments in KaTypeProvider.augmentedByWarningLevelAnnotations
^KT-80357 fixed
1 parent bffc398 commit ab248e6

File tree

6 files changed

+8
-6
lines changed

6 files changed

+8
-6
lines changed

analysis/analysis-api-fe10/src/org/jetbrains/kotlin/analysis/api/descriptors/components/KaFe10TypeProvider.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ internal class KaFe10TypeProvider(
111111
override val KaType.augmentedByWarningLevelAnnotations: KaType
112112
get() = withValidityAssertion {
113113
require(this is KaFe10Type)
114-
val enhancement = (fe10Type as? TypeWithEnhancement)?.enhancement
114+
val enhancement = fe10Type.getEnhancementDeeply()
115115
return enhancement?.toKtType(analysisContext) ?: this
116116
}
117117

analysis/analysis-api-fir/src/org/jetbrains/kotlin/analysis/api/fir/components/KaFirTypeProvider.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,11 @@ internal class KaFirTypeProvider(
151151
require(this is KaFirType)
152152
val coneType = coneType
153153
val substitutor = EnhancedForWarningConeSubstitutor(typeContext)
154-
val enhancedConeType = substitutor.substituteType(coneType)
154+
val enhancedConeType = substitutor.substituteOrNull(coneType)
155155

156156
return enhancedConeType?.asKaType() ?: this
157157
}
158-
158+
159159
override val KaClassifierSymbol.defaultType: KaType
160160
get() = withValidityAssertion {
161161
with(analysisSession) {
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
expression: a.bar() to "myPair"
2-
type: kotlin.Pair<kotlin.String!, kotlin.String>
2+
type: kotlin.Pair<kotlin.String, kotlin.String>
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
expression: a.bar() to "myPair"
2-
type: kotlin.Pair<kotlin.String!, kotlin.String>
2+
type: kotlin.Pair<kotlin.String?, kotlin.String>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
expression: a.externalNotNullMethod() to "myPair"
2+
type: kotlin.Pair<kotlin.String!, kotlin.String>
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
expression: a.externalNotNullMethod() to "myPair"
2-
type: kotlin.Pair<kotlin.String!, kotlin.String>
2+
type: kotlin.Pair<kotlin.String, kotlin.String>

0 commit comments

Comments
 (0)