Revert "Make freshly substituted type variables def not nullable if they come from not null type parameter"
This reverts commit 41936a790b37bef45d7e7dad851856ea1750ef01.
This commit is contained in:
+1
-6
@@ -9,7 +9,6 @@ import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.annotations.CompositeAnnotations
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.isCaptured
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.model.TypeVariableFromCallableDescriptor
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.model.TypeVariableTypeConstructor
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.substitute
|
||||
import org.jetbrains.kotlin.types.*
|
||||
import org.jetbrains.kotlin.types.checker.NewCapturedType
|
||||
@@ -158,11 +157,7 @@ interface NewTypeSubstitutor : TypeSubstitutorMarker {
|
||||
replacement = replacement.makeDefinitelyNotNullOrNotNull()
|
||||
}
|
||||
if (type is CustomTypeParameter) {
|
||||
replacement = type.substitutionResult(replacement).unwrap().run {
|
||||
if (type is NotNullTypeVariable && replacement.constructor is TypeVariableTypeConstructor) {
|
||||
makeDefinitelyNotNullOrNotNull()
|
||||
} else this
|
||||
}
|
||||
replacement = type.substitutionResult(replacement).unwrap()
|
||||
}
|
||||
|
||||
return replacement
|
||||
|
||||
Reference in New Issue
Block a user