[FIR] Add FINAL_UPPER_BOUND checker

This commit is contained in:
Andrey Zinovyev
2021-04-05 14:51:44 +03:00
committed by GitHub
parent d0513c9ece
commit 67505a0071
36 changed files with 232 additions and 180 deletions
@@ -35,7 +35,7 @@ inline fun <reified T>case_3(x: Any?) {
}
// TESTCASE NUMBER: 4
inline fun <reified T : Boolean>case_4(x: Any?) {
inline fun <reified T : <!FINAL_UPPER_BOUND!>Boolean<!>>case_4(x: Any?) {
if (x is Int is T == null) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>.<!UNRESOLVED_REFERENCE!>inv<!>()
@@ -97,8 +97,8 @@ fun case_9() {
* UNEXPECTED BEHAVIOUR
* ISSUES: KT-22175
*/
fun <T : String> T?.case_10() = this
fun <T : Int> T?.case_10() = this
fun <T : <!FINAL_UPPER_BOUND!>String<!>> T?.case_10() = this
fun <T : <!FINAL_UPPER_BOUND!>Int<!>> T?.case_10() = this
fun case_10() {
var x: Int? = 10
x = null
@@ -106,7 +106,7 @@ fun case_10() {
}
// TESTCASE NUMBER: 11
fun <T : String> T?.case_11() = this
fun <T : <!FINAL_UPPER_BOUND!>String<!>> T?.case_11() = this
fun case_11() {
var x: Int? = 10
x = null