Process simple CapturedType in ClassicTypeSystemContext.typeConstructorProjection as well

^KT-49101 Fixed
This commit is contained in:
Victor Petukhov
2021-10-19 14:21:55 +03:00
parent 836c6b280d
commit 2261928f4f
7 changed files with 67 additions and 2 deletions
@@ -455,8 +455,11 @@ interface ClassicTypeSystemContext : TypeSystemInferenceExtensionContext, TypeSy
}
override fun CapturedTypeMarker.typeConstructorProjection(): TypeArgumentMarker {
require(this is NewCapturedType, this::errorMessage)
return this.constructor.projection
return when (this) {
is NewCapturedType -> this.constructor.projection
is CapturedType -> this.typeProjection
else -> error("Unsupported captured type")
}
}
override fun CapturedTypeMarker.withNotNullProjection(): KotlinTypeMarker {