// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_VARIABLE -UNUSED_VALUE // SKIP_TXT /* * KOTLIN DIAGNOSTICS NOT LINKED SPEC TEST (POSITIVE) * * SECTIONS: dfa * NUMBER: 50 * DESCRIPTION: Raw data flow analysis test * HELPERS: classes, objects, typealiases, functions, enumClasses, interfaces, sealedClasses */ // TESTCASE NUMBER: 1 fun Any.case_1() { if (this is Inv<*>) { "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any"), DEBUG_INFO_SMARTCAST!>this.test() "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any"), DEBUG_INFO_SMARTCAST!>this.prop_4 "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any"), DEBUG_INFO_SMARTCAST!>this.prop_4.inv() prop_4 prop_4.inv() } } // TESTCASE NUMBER: 2 fun Any.case_2() { if (this is ClassWithSixTypeParameters<*, *, *, *, *, *>) { "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any"), DEBUG_INFO_SMARTCAST!>this.test() "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any"), DEBUG_INFO_SMARTCAST!>this.x "), DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any"), DEBUG_INFO_SMARTCAST!>this.y x y } } // TESTCASE NUMBER: 3 fun T.case_3() { if (this is Inv<*>) { "), DEBUG_INFO_EXPRESSION_TYPE("T"), DEBUG_INFO_SMARTCAST!>this.test() "), DEBUG_INFO_EXPRESSION_TYPE("T"), DEBUG_INFO_SMARTCAST!>this.prop_4 "), DEBUG_INFO_EXPRESSION_TYPE("T"), DEBUG_INFO_SMARTCAST!>this.prop_4.inv() prop_4 prop_4.inv() } } // TESTCASE NUMBER: 4 fun T?.case_4() { if (this is ClassWithSixTypeParameters<*, *, *, *, *, *>) { "), DEBUG_INFO_EXPRESSION_TYPE("T?"), DEBUG_INFO_SMARTCAST!>this.test() "), DEBUG_INFO_EXPRESSION_TYPE("T?"), DEBUG_INFO_SMARTCAST!>this.x "), DEBUG_INFO_EXPRESSION_TYPE("T?"), DEBUG_INFO_SMARTCAST!>this.y x y } } // TESTCASE NUMBER: 5 fun ClassWithSixTypeParameters.case_5() { if (this is InterfaceWithFiveTypeParameters1<*, *, *, *, *>) { & InterfaceWithFiveTypeParameters1<*, *, *, *, *>"), DEBUG_INFO_EXPRESSION_TYPE("ClassWithSixTypeParameters")!>this.itest1() itest1() & InterfaceWithFiveTypeParameters1<*, *, *, *, *>"), DEBUG_INFO_EXPRESSION_TYPE("ClassWithSixTypeParameters")!>this.test() & InterfaceWithFiveTypeParameters1<*, *, *, *, *>"), DEBUG_INFO_EXPRESSION_TYPE("ClassWithSixTypeParameters")!>this.x & InterfaceWithFiveTypeParameters1<*, *, *, *, *>"), DEBUG_INFO_EXPRESSION_TYPE("ClassWithSixTypeParameters")!>this.y x y } } /* * TESTCASE NUMBER: 6 * ISSUES: KT-25432 */ fun case_6(y: Inv) { if (y.prop_3 is MutableList<*>) { ")!>y.prop_3 "), DEBUG_INFO_SMARTCAST!>y.prop_3[0] } } /* * TESTCASE NUMBER: 7 * ISSUES: KT-25432 */ fun Inv.case_7() { if (this.prop_3 is MutableList<*>) { ")!>this.prop_3 "), DEBUG_INFO_SMARTCAST!>this.prop_3[0] ")!>prop_3 "), DEBUG_INFO_SMARTCAST!>prop_3[0] } } // TESTCASE NUMBER: 8 fun T.case_8() { this as MutableList ")!>this::equals this.equals(10) ")!>::equals equals(10) } /* * TESTCASE NUMBER: 9 * ISSUES: KT-8966 */ fun T.case_9() { if (this is String) { this this.length length } }