Substitute captured types with inner intersection one (NewTypeSubstitutor)

^KT-44651 Fixed
This commit is contained in:
Victor Petukhov
2021-02-09 12:58:53 +03:00
parent 80daf120e6
commit f797ee7803
6 changed files with 39 additions and 1 deletions
@@ -105,7 +105,7 @@ interface NewTypeSubstitutor : TypeSubstitutorMarker {
val substitutedInnerType = substitute(innerType, keepAnnotation, runCapturedChecks = false)
if (substitutedInnerType != null) {
if (innerType is StubType || substitutedInnerType is StubType) {
if (innerType is StubType || substitutedInnerType is StubType || innerType.constructor is IntersectionTypeConstructor) {
return NewCapturedType(
capturedType.captureStatus,
NewCapturedTypeConstructor(