NI: Discard definitely not-null types inside invariant positions during inference process

^KT-36816 Fixed
This commit is contained in:
Victor Petukhov
2020-02-18 19:09:46 +03:00
parent 36f4b6daf3
commit 748a326104
8 changed files with 102 additions and 3 deletions
@@ -83,7 +83,10 @@ open class TypeApproximatorConfiguration {
override val typeVariable: (TypeVariableTypeConstructorMarker) -> Boolean get() = { true }
}
object IncorporationConfiguration : TypeApproximatorConfiguration.AbstractCapturedTypesApproximation(FOR_INCORPORATION)
object IncorporationConfiguration : TypeApproximatorConfiguration.AbstractCapturedTypesApproximation(FOR_INCORPORATION) {
override val definitelyNotNullTypeInInvariantPosition: Boolean get() = false
}
object SubtypeCapturedTypesApproximation : TypeApproximatorConfiguration.AbstractCapturedTypesApproximation(FOR_SUBTYPING)
object CapturedAndIntegerLiteralsTypesApproximation : TypeApproximatorConfiguration.AbstractCapturedTypesApproximation(FROM_EXPRESSION) {
override val integerLiteralType: Boolean get() = true