diff --git a/core/descriptors/src/org/jetbrains/kotlin/types/TypeSubstitution.kt b/core/descriptors/src/org/jetbrains/kotlin/types/TypeSubstitution.kt index 88f2ddddd5e..d8c0d699e6d 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/types/TypeSubstitution.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/types/TypeSubstitution.kt @@ -119,13 +119,13 @@ fun KotlinType.computeNewSubstitution( fun KotlinType.replace( newArguments: List, - annotations: Annotations = this@replace.annotations + newAnnotations: Annotations = annotations ): KotlinType { - if (newArguments.isEmpty() && annotations === this.annotations) return this + if (newArguments.isEmpty() && newAnnotations === annotations) return this if (newArguments.isEmpty()) { return KotlinTypeImpl.create( - annotations, + newAnnotations, constructor, isMarkedNullable, arguments, @@ -144,7 +144,7 @@ fun KotlinType.replace( else ErrorUtils.createErrorScope("Unexpected declaration descriptor for type constructor: $constructor") return KotlinTypeImpl.create( - annotations, + newAnnotations, constructor, isMarkedNullable, newArguments,