Approximate definitely not-null types for type parameter's types if they are already not-null (has not-null upper bounds)

^KT-44440 Fixed
This commit is contained in:
Victor Petukhov
2021-01-21 14:57:28 +03:00
parent f2c1608c2b
commit f06a5321a6
12 changed files with 144 additions and 45 deletions
@@ -464,7 +464,7 @@ fun <T : Number> T?.case_11() {
equals(this)
itest1()
apply {
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>this<!>
equals(null)
propT
propAny
@@ -475,29 +475,29 @@ fun <T : Number> T?.case_11() {
funNullableT()
funNullableAny()
itest1()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>this<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>this<!>.propT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>this<!>.propAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>this<!>.propNullableT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>this<!>.propNullableAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>this<!>.funT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>this<!>.funAny()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>this<!>.funNullableT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>this<!>.funNullableAny()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>this<!>.itest1()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>this<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>this<!>.propT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>this<!>.propAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>this<!>.propNullableT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>this<!>.propNullableAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>this<!>.funT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>this<!>.funAny()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>this<!>.funNullableT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>this<!>.funNullableAny()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>this<!>.itest1()
}
also {
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>it<!>
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>it<!>.itest1()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>it<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>it<!>.propT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>it<!>.propAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>it<!>.propNullableT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>it<!>.propNullableAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>it<!>.funT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>it<!>.funAny()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>it<!>.funNullableT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>it<!>.funNullableAny()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>it<!>
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>it<!>.itest1()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>it<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>it<!>.propT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>it<!>.propAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>it<!>.propNullableT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>it<!>.propNullableAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>it<!>.funT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>it<!>.funAny()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>it<!>.funNullableT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>it<!>.funNullableAny()
}
}
}
@@ -564,7 +564,7 @@ fun <T : Number> case_11(x: T?) {
x.funNullableAny()
x.itest()
x.apply {
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>this<!>
equals(null)
propT
propAny
@@ -575,29 +575,29 @@ fun <T : Number> case_11(x: T?) {
funNullableT()
funNullableAny()
itest()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>this<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>this<!>.propT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>this<!>.propAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>this<!>.propNullableT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>this<!>.propNullableAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>this<!>.funT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>this<!>.funAny()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>this<!>.funNullableT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>this<!>.funNullableAny()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>this<!>.itest()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>this<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>this<!>.propT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>this<!>.propAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>this<!>.propNullableT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>this<!>.propNullableAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>this<!>.funT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>this<!>.funAny()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>this<!>.funNullableT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>this<!>.funNullableAny()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>this<!>.itest()
}
x.also {
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>it<!>
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>it<!>.itest()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>it<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>it<!>.propT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>it<!>.propAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>it<!>.propNullableT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>it<!>.propNullableAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>it<!>.funT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>it<!>.funAny()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>it<!>.funNullableT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T?!!")!>it<!>.funNullableAny()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>it<!>
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>it<!>.itest()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>it<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>it<!>.propT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>it<!>.propAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>it<!>.propNullableT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>it<!>.propNullableAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>it<!>.funT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>it<!>.funAny()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>it<!>.funNullableT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & T")!>it<!>.funNullableAny()
}
}
}