diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/components/NewTypeSubstitutor.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/components/NewTypeSubstitutor.kt index 4f4802c1214..2b8a8210d6b 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/components/NewTypeSubstitutor.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/inference/components/NewTypeSubstitutor.kt @@ -54,6 +54,18 @@ interface NewTypeSubstitutor { private fun substitute(type: SimpleType, runCapturedChecks: Boolean): UnwrappedType? { if (type.isError) return null + if (type is AbbreviatedType) { + val substitutedExpandedType = substitute(type.expandedType, runCapturedChecks) + val substitutedAbbreviation = substitute(type.abbreviation, runCapturedChecks) + if (substitutedExpandedType is SimpleType? && substitutedAbbreviation is SimpleType?) { + return AbbreviatedType(substitutedExpandedType ?: type.expandedType, + substitutedAbbreviation ?: type.abbreviation) + } + else { + return substitutedExpandedType + } + } + if (type.arguments.isNotEmpty()) { return substituteParametrizedType(type, runCapturedChecks) }