[NI] Fix exception on capturing stub type from coroutine-inference
#KT-30853 Fixed
This commit is contained in:
+8
@@ -75,6 +75,14 @@ interface NewTypeSubstitutor: TypeSubstitutorMarker {
|
||||
}
|
||||
val capturedType = if (type is DefinitelyNotNullType) type.original as NewCapturedType else type as NewCapturedType
|
||||
val lower = capturedType.lowerType?.let { substitute(it, keepAnnotation, runCapturedChecks = false) }
|
||||
if (lower != null && capturedType.lowerType is StubType) {
|
||||
return NewCapturedType(
|
||||
capturedType.captureStatus,
|
||||
NewCapturedTypeConstructor(TypeProjectionImpl(typeConstructor.projection.projectionKind, lower)),
|
||||
lower
|
||||
)
|
||||
}
|
||||
|
||||
if (lower != null) throw IllegalStateException(
|
||||
"Illegal type substitutor: $this, " +
|
||||
"because for captured type '$type' lower type approximation should be null, but it is: '$lower'," +
|
||||
|
||||
Reference in New Issue
Block a user