// !DIAGNOSTICS: -UNUSED_EXPRESSION // SKIP_TXT /* * KOTLIN DIAGNOSTICS NOT LINKED SPEC TEST (POSITIVE) * * SECTIONS: dfa * NUMBER: 8 * DESCRIPTION: Raw data flow analysis test * HELPERS: properties, classes, functions */ // TESTCASE NUMBER: 1 fun case_1(x: Inv?) { if (x != null) { ? & Inv")!>x ? & Inv")!>x.equals(null) ? & Inv")!>x.propT ? & Inv")!>x.propAny ? & Inv")!>x.propNullableT ? & Inv")!>x.propNullableAny ? & Inv")!>x.funT() ? & Inv")!>x.funAny() ? & Inv")!>x.funNullableT() ? & Inv")!>x.funNullableAny() } } // TESTCASE NUMBER: 2 fun case_2(a: Inv?>?>?>?>?>?) { if (a != null) { val b = ?>?>?>?>?>? & Inv?>?>?>?>?>")!>a.get() if (b != null) { val c = ?>?>?>?>? & Inv?>?>?>?>")!>b.get() if (c != null) { val d = ?>?>?>? & Inv?>?>?>")!>c.get() if (d != null) { val e = ?>?>? & Inv?>?>")!>d.get() if (e != null) { val f = ?>? & Inv?>")!>e.get() if (f != null) { val g = ? & Inv")!>f.get() if (g != null) { g g.equals(null) g.propT g.propAny g.propNullableT g.propNullableAny g.funT() g.funAny() g.funNullableT() g.funNullableAny() } } } } } } } } // TESTCASE NUMBER: 3 fun case_3(a: Inv?) { if (a != null) { val b = a if (a == null) { ? & kotlin.Nothing")!>b ? & kotlin.Nothing")!>b.equals(null) ? & kotlin.Nothing")!>b.propT ? & kotlin.Nothing")!>b.propAny ? & kotlin.Nothing")!>b.propNullableT ? & kotlin.Nothing")!>b.propNullableAny ? & kotlin.Nothing")!>b.funT() ? & kotlin.Nothing")!>b.funAny() ? & kotlin.Nothing")!>b.funNullableT() ? & kotlin.Nothing")!>b.funNullableAny() } } } // TESTCASE NUMBER: 4 fun case_4(a: Inv?, b: Inv = if (a != null) ? & Inv")!>a else Inv()) { ?")!>a ")!>b ")!>b.equals(null) ")!>b.propT ")!>b.propAny ")!>b.propNullableT ")!>b.propNullableAny ")!>b.funT() ")!>b.funAny() ")!>b.funNullableT() ")!>b.funNullableAny() } // TESTCASE NUMBER: 5 fun case_5() { if (nullableOut != null) { ? & Out")!>nullableOut ? & Out")!>nullableOut.equals(null) ? & Out")!>nullableOut.propT ? & Out")!>nullableOut.propAny ? & Out")!>nullableOut.propNullableT ? & Out")!>nullableOut.propNullableAny ? & Out")!>nullableOut.funT() ? & Out")!>nullableOut.funAny() ? & Out")!>nullableOut.funNullableT() ? & Out")!>nullableOut.funNullableAny() } } // TESTCASE NUMBER: 6 fun case_6() { val x: Inv? = null if (x != null) { ? & Inv")!>x ? & Inv")!>x.equals(null) ? & Inv")!>x.propT ? & Inv")!>x.propAny ? & Inv")!>x.propNullableT ? & Inv")!>x.propNullableAny ? & Inv")!>x.funT() ? & Inv")!>x.funAny() ? & Inv")!>x.funNullableT() ? & Inv")!>x.funNullableAny() } } // TESTCASE NUMBER: 7 fun case_7() { var x: Inv? = null if (x != null) { ? & Inv")!>x ? & Inv")!>x.equals(null) ? & Inv")!>x.propT ? & Inv")!>x.propAny ? & Inv")!>x.propNullableT ? & Inv")!>x.propNullableAny ? & Inv")!>x.funT() ? & Inv")!>x.funAny() ? & Inv")!>x.funNullableT() ? & Inv")!>x.funNullableAny() } } // TESTCASE NUMBER: 8 fun case_8(x: ClassWithThreeTypeParameters?>?) { if (x != null) { ?>? & ClassWithThreeTypeParameters?>")!>x ?>? & ClassWithThreeTypeParameters?>")!>x.equals(null) ?>? & ClassWithThreeTypeParameters?>")!>x.propT ?>? & ClassWithThreeTypeParameters?>")!>x.propAny ?>? & ClassWithThreeTypeParameters?>")!>x.propNullableT ?>? & ClassWithThreeTypeParameters?>")!>x.propNullableAny ?>? & ClassWithThreeTypeParameters?>")!>x.funT() ?>? & ClassWithThreeTypeParameters?>")!>x.funAny() ?>? & ClassWithThreeTypeParameters?>")!>x.funNullableT() ?>? & ClassWithThreeTypeParameters?>")!>x.funNullableAny() if (x.x != null) { x.x x.x.equals(null) x.x.propT x.x.propAny x.x.propNullableT x.x.propNullableAny x.x.funT() x.x.funAny() x.x.funNullableT() x.x.funNullableAny() } if (x.y != null) { x.y x.y.equals(null) x.y.propT x.y.propAny x.y.propNullableT x.y.propNullableAny x.y.funT() x.y.funAny() x.y.funNullableT() x.y.funNullableAny() } if (x.z != null) { x.z x.z.equals(null) x.z.propT x.z.propAny x.z.propNullableT x.z.propNullableAny x.z.funT() x.z.funAny() x.z.funNullableT() x.z.funNullableAny() if (x.z.x != null) { x.z.x x.z.x.equals(null) x.z.x.propT x.z.x.propAny x.z.x.propNullableT x.z.x.propNullableAny x.z.x.funT() x.z.x.funAny() x.z.x.funNullableT() x.z.x.funNullableAny() } if (x.z.y != null && x.z.z != null) { x.z.y x.z.y.equals(null) x.z.y.propT x.z.y.propAny x.z.y.propNullableT x.z.y.propNullableAny x.z.y.funT() x.z.y.funAny() x.z.y.funNullableT() x.z.y.funNullableAny() x.z.z x.z.z.equals(null) x.z.z.propT x.z.z.propAny x.z.z.propNullableT x.z.z.propNullableAny x.z.z.funT() x.z.z.funAny() x.z.z.funNullableT() x.z.z.funNullableAny() } } } }