Files
kotlin-fork/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/41.fir.kt
T
Dmitriy Novozhilov 2b39282682 [FIR] Render original type before smartcasted type in DEBUG_INFO_EXPRESSION_TYPE
This is made for keep consistency with same renderer in FE 1.0
2021-02-16 17:51:32 +03:00

58 lines
1.6 KiB
Kotlin
Vendored

// !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_EXPRESSION
// SKIP_TXT
/*
* TESTCASE NUMBER: 1
* ISSUES: KT-28362
*/
fun case_1(x: Any) {
if (x is Interface1) {
if (x is Interface2) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & Interface1 & Interface2")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & Interface1 & Interface2")!>x<!>.itest()
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & Interface1 & Interface2")!>x<!>.itest1()
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & Interface1 & Interface2")!>x<!>.itest2()
}
}
}
/*
* TESTCASE NUMBER: 2
* ISSUES: KT-28362
*/
fun case_2(x: Any) {
if (x is Interface2) {
if (x is Interface1) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & Interface2 & Interface1")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & Interface2 & Interface1")!>x<!>.itest0()
}
}
}
/*
* TESTCASE NUMBER: 3
* ISSUES: KT-28362
*/
fun case_3(x: Any) {
if (x is Interface1) {
if (x is Interface2) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & Interface1 & Interface2")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & Interface1 & Interface2")!>x<!>.itest000()
}
}
}
/*
* TESTCASE NUMBER: 4
* ISSUES: KT-28362
*/
fun case_4(x: Any) {
if (x is Interface2) {
if (x is Interface1) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & Interface2 & Interface1")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & Interface2 & Interface1")!>x<!>.itest0000()
}
}
}