// !DIAGNOSTICS: -UNUSED_EXPRESSION // SKIP_TXT /* * KOTLIN DIAGNOSTICS NOT LINKED SPEC TEST (POSITIVE) * * SECTIONS: dfa * NUMBER: 15 * DESCRIPTION: Raw data flow analysis test * NOTE: performance test * HELPERS: classes, interfaces, functions, properties */ // TESTCASE NUMBER: 1 open class Case1_1 : InterfaceWithTypeParameter1 open class Case1_2 : InterfaceWithTypeParameter1 fun case_1() { val a = select(Case1_1(), Case1_2(), null) if (a != null) { & InterfaceWithTypeParameter1<*>?")!>a val b = & InterfaceWithTypeParameter1<*>?")!>a.ip1test1() if (b != null) { b b.equals(null) b.propT b.propAny b.propNullableT b.propNullableAny b.funT() b.funAny() b.funNullableT() b.funNullableAny() } } } // TESTCASE NUMBER: 2 class Case2_1 : Interface3, InterfaceWithTypeParameter1 class Case2_2 : Interface3, InterfaceWithTypeParameter1 fun case_2() { val x = select(Case2_1(), Case2_2(), null) if (x != null) { } & {Interface3 & InterfaceWithTypeParameter1<*>}?")!>x } & {Interface3 & InterfaceWithTypeParameter1<*>}?")!>x.ip1test1() } } // TESTCASE NUMBER: 3 class Case3_1 : Interface3, InterfaceWithTypeParameter1, InterfaceWithTypeParameter2 class Case3_2 : Interface3, InterfaceWithTypeParameter1, InterfaceWithTypeParameter2 fun case_3() { val x = select(Case3_1(), Case3_2(), null) if (x != null) { & InterfaceWithTypeParameter2<*>} & {Interface3 & InterfaceWithTypeParameter1<*> & InterfaceWithTypeParameter2<*>}?")!>x & InterfaceWithTypeParameter2<*>} & {Interface3 & InterfaceWithTypeParameter1<*> & InterfaceWithTypeParameter2<*>}?")!>x.ip1test1() & InterfaceWithTypeParameter2<*>} & {Interface3 & InterfaceWithTypeParameter1<*> & InterfaceWithTypeParameter2<*>}?")!>x.ip1test2() } } // TESTCASE NUMBER: 4 class Case4_1 : InterfaceWithTypeParameter1, InterfaceWithTypeParameter2 class Case4_2 : InterfaceWithTypeParameter1, InterfaceWithTypeParameter2 fun case_4() { val x = select(Case4_1(), Case4_2(), null) if (x != null) { & InterfaceWithTypeParameter2<*>} & {InterfaceWithTypeParameter1<*> & InterfaceWithTypeParameter2<*>}?")!>x & InterfaceWithTypeParameter2<*>} & {InterfaceWithTypeParameter1<*> & InterfaceWithTypeParameter2<*>}?")!>x.ip1test1() & InterfaceWithTypeParameter2<*>} & {InterfaceWithTypeParameter1<*> & InterfaceWithTypeParameter2<*>}?")!>x.ip1test2() } } // TESTCASE NUMBER: 5 class Case5_1 : InterfaceWithTypeParameter1>, InterfaceWithTypeParameter2> class Case5_2 : InterfaceWithTypeParameter2>, InterfaceWithTypeParameter1> fun case_5() { val x = select(Case5_1(), Case5_2(), null) if (x != null) { > & InterfaceWithTypeParameter2>} & {InterfaceWithTypeParameter1> & InterfaceWithTypeParameter2>}?")!>x > & InterfaceWithTypeParameter2>} & {InterfaceWithTypeParameter1> & InterfaceWithTypeParameter2>}?"), DEBUG_INFO_SMARTCAST!>x.ip1test1() > & InterfaceWithTypeParameter2>} & {InterfaceWithTypeParameter1> & InterfaceWithTypeParameter2>}?"), DEBUG_INFO_SMARTCAST!>x.ip1test2() } } // TESTCASE NUMBER: 6 class Case6_1 : InterfaceWithTypeParameter1>, InterfaceWithTypeParameter2>> class Case6_2 : InterfaceWithTypeParameter2>>, InterfaceWithTypeParameter1> fun case_6() { val x = select(Case6_1(), Case6_2(), null) if (x != null) { & Number}>> & InterfaceWithTypeParameter2> & InterfaceWithTypeParameter2<*>}>>} & {InterfaceWithTypeParameter1 & Number}>>? & InterfaceWithTypeParameter2> & InterfaceWithTypeParameter2<*>}>>?}")!>x & Number}>> & InterfaceWithTypeParameter2> & InterfaceWithTypeParameter2<*>}>>} & {InterfaceWithTypeParameter1 & Number}>>? & InterfaceWithTypeParameter2> & InterfaceWithTypeParameter2<*>}>>?}")!>x.ip1test1() & Number}>> & InterfaceWithTypeParameter2> & InterfaceWithTypeParameter2<*>}>>} & {InterfaceWithTypeParameter1 & Number}>>? & InterfaceWithTypeParameter2> & InterfaceWithTypeParameter2<*>}>>?}")!>x.ip1test2() } } // TESTCASE NUMBER: 7 open class Case7_1 : InterfaceWithTwoTypeParameters, Inv> open class Case7_2 : InterfaceWithTwoTypeParameters, Inv> fun case_7() { val x = select(Case7_1(), Case7_2(), null) if (x != null) { & java.io.Serializable}>, out Inv & java.io.Serializable}>> & InterfaceWithTwoTypeParameters & java.io.Serializable}>, out Inv & java.io.Serializable}>>?")!>x & java.io.Serializable}>, out Inv & java.io.Serializable}>> & InterfaceWithTwoTypeParameters & java.io.Serializable}>, out Inv & java.io.Serializable}>>?")!>x.ip2test() } } // TESTCASE NUMBER: 8 open class Case8_1 : ClassWithTwoTypeParameters, K>() open class Case8_2 : ClassWithTwoTypeParameters, T>() fun case_8() { val x = select(Case8_1(), Case8_2(), null) if (x != null) { & java.io.Serializable}, out {Comparable<*> & java.io.Serializable}>, out {Comparable<*> & java.io.Serializable}> & ClassWithTwoTypeParameters & java.io.Serializable}, out {Comparable<*> & java.io.Serializable}>, out {Comparable<*> & java.io.Serializable}>?")!>x & java.io.Serializable}, out {Comparable<*> & java.io.Serializable}>, out {Comparable<*> & java.io.Serializable}> & ClassWithTwoTypeParameters & java.io.Serializable}, out {Comparable<*> & java.io.Serializable}>, out {Comparable<*> & java.io.Serializable}>?")!>x.test1() val y = & java.io.Serializable}, out {Comparable<*> & java.io.Serializable}>, out {Comparable<*> & java.io.Serializable}> & ClassWithTwoTypeParameters & java.io.Serializable}, out {Comparable<*> & java.io.Serializable}>, out {Comparable<*> & java.io.Serializable}>?")!>x.test2() if (y != null) { & java.io.Serializable}, out {Comparable<*> & java.io.Serializable}> & ClassWithTwoTypeParameters & java.io.Serializable}, out {Comparable<*> & java.io.Serializable}>?")!>y & java.io.Serializable}, out {Comparable<*> & java.io.Serializable}> & ClassWithTwoTypeParameters & java.io.Serializable}, out {Comparable<*> & java.io.Serializable}>?")!>y.test1() val z = & java.io.Serializable}, out {Comparable<*> & java.io.Serializable}> & ClassWithTwoTypeParameters & java.io.Serializable}, out {Comparable<*> & java.io.Serializable}>?")!>y.test2() if (z != null) { & java.io.Serializable} & {Comparable<*> & java.io.Serializable}?")!>z & java.io.Serializable} & {Comparable<*> & java.io.Serializable}?")!>z.equals(null) & java.io.Serializable} & {Comparable<*> & java.io.Serializable}?")!>z.propT & java.io.Serializable} & {Comparable<*> & java.io.Serializable}?")!>z.propAny & java.io.Serializable} & {Comparable<*> & java.io.Serializable}?")!>z.propNullableT & java.io.Serializable} & {Comparable<*> & java.io.Serializable}?")!>z.propNullableAny & java.io.Serializable} & {Comparable<*> & java.io.Serializable}?")!>z.funT() & java.io.Serializable} & {Comparable<*> & java.io.Serializable}?")!>z.funAny() & java.io.Serializable} & {Comparable<*> & java.io.Serializable}?")!>z.funNullableT() & java.io.Serializable} & {Comparable<*> & java.io.Serializable}?")!>z.funNullableAny() } } } } // TESTCASE NUMBER: 9 open class Case9_1 : ClassWithTwoTypeParameters, Case9_2>() open class Case9_2 : ClassWithTwoTypeParameters, Case9_1>() fun case_9() { val x = select(Case9_1(), Case9_2(), null) if (x != null) { & ClassWithTwoTypeParameters<*, *>?")!>x & ClassWithTwoTypeParameters<*, *>?")!>x.test1() val y = x.test2() if (y != null) { y y y.equals(null) y.propT y.propAny y.propNullableT y.propNullableAny y.funT() y.funAny() y.funNullableT() y.funNullableAny() } } } // TESTCASE NUMBER: 10 open class Case10_1 : Interface3, InterfaceWithOutParameter open class Case10_2 : Interface3, InterfaceWithOutParameter fun case_10() = run { val x = select(object : Case10_1() {}, object : Case10_2() {}, null) if (x != null) { }>} & {Interface3 & InterfaceWithOutParameter<{Interface3 & InterfaceWithOutParameter<*>}>}?")!>x }>} & {Interface3 & InterfaceWithOutParameter<{Interface3 & InterfaceWithOutParameter<*>}>}?"), DEBUG_INFO_SMARTCAST!>x.equals(null) }>} & {Interface3 & InterfaceWithOutParameter<{Interface3 & InterfaceWithOutParameter<*>}>}?"), DEBUG_INFO_SMARTCAST!>x.propT }>} & {Interface3 & InterfaceWithOutParameter<{Interface3 & InterfaceWithOutParameter<*>}>}?"), DEBUG_INFO_SMARTCAST!>x.propAny }>} & {Interface3 & InterfaceWithOutParameter<{Interface3 & InterfaceWithOutParameter<*>}>}?")!>x.propNullableT }>} & {Interface3 & InterfaceWithOutParameter<{Interface3 & InterfaceWithOutParameter<*>}>}?")!>x.propNullableAny }>} & {Interface3 & InterfaceWithOutParameter<{Interface3 & InterfaceWithOutParameter<*>}>}?"), DEBUG_INFO_SMARTCAST!>x.funT() }>} & {Interface3 & InterfaceWithOutParameter<{Interface3 & InterfaceWithOutParameter<*>}>}?"), DEBUG_INFO_SMARTCAST!>x.funAny() }>} & {Interface3 & InterfaceWithOutParameter<{Interface3 & InterfaceWithOutParameter<*>}>}?")!>x.funNullableT() }>} & {Interface3 & InterfaceWithOutParameter<{Interface3 & InterfaceWithOutParameter<*>}>}?")!>x.funNullableAny() } }