[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 {
|
} else {
|
||||||
val lowerBound = substitute(type.lowerBound, keepAnnotation, runCapturedChecks)
|
val lowerBound = substitute(type.lowerBound, keepAnnotation, runCapturedChecks)
|
||||||
val upperBound = substitute(type.upperBound, keepAnnotation, runCapturedChecks)
|
val upperBound = substitute(type.upperBound, keepAnnotation, runCapturedChecks)
|
||||||
val enhancement =
|
val enhancement = if (type is TypeWithEnhancement) {
|
||||||
if (type is TypeWithEnhancement) substituteTypeEnhancement(type, keepAnnotation, runCapturedChecks) else null
|
substituteTypeEnhancement(type.enhancement, keepAnnotation, runCapturedChecks)
|
||||||
|
} else null
|
||||||
|
|
||||||
if (lowerBound == null && upperBound == null) {
|
if (lowerBound == null && upperBound == null) {
|
||||||
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>(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>)
|
||||||
a1.bar<T>(x)
|
a1.bar<T>(x)
|
||||||
|
|
||||||
// jspecify_nullness_mismatch{mute}
|
// jspecify_nullness_mismatch
|
||||||
a2.foo(null)
|
a2.foo(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>)
|
||||||
a2.bar<Test?>(null)
|
a2.bar<Test?>(null)
|
||||||
// jspecify_nullness_mismatch
|
// jspecify_nullness_mismatch
|
||||||
a2.bar<T>(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>)
|
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>(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>)
|
||||||
a1.bar<T>(x)
|
a1.bar<T>(x)
|
||||||
|
|
||||||
// jspecify_nullness_mismatch{mute}
|
// jspecify_nullness_mismatch
|
||||||
a2.foo(null)
|
a2.foo(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>)
|
||||||
a2.bar<Test?>(null)
|
a2.bar<Test?>(null)
|
||||||
// jspecify_nullness_mismatch
|
// jspecify_nullness_mismatch
|
||||||
a2.bar<T>(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>)
|
a2.bar<T>(<!NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS!>null<!>)
|
||||||
|
|||||||
Reference in New Issue
Block a user