[Jspecify] Substitute enhancement of type instead of type itself directly
This commit is contained in:
+3
-2
@@ -54,8 +54,9 @@ interface NewTypeSubstitutor : TypeSubstitutorMarker {
|
||||
} else {
|
||||
val lowerBound = substitute(type.lowerBound, keepAnnotation, runCapturedChecks)
|
||||
val upperBound = substitute(type.upperBound, keepAnnotation, runCapturedChecks)
|
||||
val enhancement =
|
||||
if (type is TypeWithEnhancement) substituteTypeEnhancement(type, keepAnnotation, runCapturedChecks) else null
|
||||
val enhancement = if (type is TypeWithEnhancement) {
|
||||
substituteTypeEnhancement(type.enhancement, keepAnnotation, runCapturedChecks)
|
||||
} else null
|
||||
|
||||
if (lowerBound == null && upperBound == null) {
|
||||
null
|
||||
|
||||
+2
-2
@@ -18,8 +18,8 @@ fun <T : Test> main(a1: NonPlatformTypeParameter<Any?>, a2: NonPlatformTypeParam
|
||||
a1.bar<T>(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>)
|
||||
a1.bar<T>(x)
|
||||
|
||||
// jspecify_nullness_mismatch{mute}
|
||||
a2.foo(null)
|
||||
// jspecify_nullness_mismatch
|
||||
a2.foo(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>)
|
||||
a2.bar<Test?>(null)
|
||||
// jspecify_nullness_mismatch
|
||||
a2.bar<T>(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>)
|
||||
|
||||
+2
-2
@@ -18,8 +18,8 @@ fun <T : Test> main(a1: NonPlatformTypeParameter<Any?>, a2: NonPlatformTypeParam
|
||||
a1.bar<T>(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>)
|
||||
a1.bar<T>(x)
|
||||
|
||||
// jspecify_nullness_mismatch{mute}
|
||||
a2.foo(null)
|
||||
// jspecify_nullness_mismatch
|
||||
a2.foo(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>)
|
||||
a2.bar<Test?>(null)
|
||||
// jspecify_nullness_mismatch
|
||||
a2.bar<T>(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>)
|
||||
|
||||
Reference in New Issue
Block a user