// !DIAGNOSTICS: -UNUSED_EXPRESSION
// SKIP_TXT
// TESTCASE NUMBER: 1
fun , C: Out> case_1(a: C, b: B) = select(a.x, b.x)
fun case_1() {
val x = case_1(Out(10), Inv(0.1))
if (x != null) {
? & kotlin.Number & kotlin.Comparable<*>")!>x
? & kotlin.Number & kotlin.Comparable<*>")!>x.equals(null)
? & kotlin.Number & kotlin.Comparable<*>")!>x.propT
? & kotlin.Number & kotlin.Comparable<*>")!>x.propAny
? & kotlin.Number & kotlin.Comparable<*>")!>x.propNullableT
? & kotlin.Number & kotlin.Comparable<*>")!>x.propNullableAny
? & kotlin.Number & kotlin.Comparable<*>")!>x.funT()
? & kotlin.Number & kotlin.Comparable<*>")!>x.funAny()
? & kotlin.Number & kotlin.Comparable<*>")!>x.funNullableT()
? & kotlin.Number & kotlin.Comparable<*>")!>x.funNullableAny()
}
}
// TESTCASE NUMBER: 2
fun , C: Out> case_2(a: C, b: B) = select(a.x, b.x)
fun case_2(y: Int) {
val x = case_2(Out(y), Inv(0.1))
if (x != null) {
? & kotlin.Number & kotlin.Comparable<*>")!>x
? & kotlin.Number & kotlin.Comparable<*>")!>x.equals(null)
? & kotlin.Number & kotlin.Comparable<*>")!>x.propT
? & kotlin.Number & kotlin.Comparable<*>")!>x.propAny
? & kotlin.Number & kotlin.Comparable<*>")!>x.propNullableT
? & kotlin.Number & kotlin.Comparable<*>")!>x.propNullableAny
? & kotlin.Number & kotlin.Comparable<*>")!>x.funT()
? & kotlin.Number & kotlin.Comparable<*>")!>x.funAny()
? & kotlin.Number & kotlin.Comparable<*>")!>x.funNullableT()
? & kotlin.Number & kotlin.Comparable<*>")!>x.funNullableAny()
}
}
/*
* TESTCASE NUMBER: 3
* ISSUES: KT-28670
*/
fun case_3(a: Int?, b: Float?, c: Double?, d: Boolean?) {
when (d) {
true -> a
false -> b
null -> c
}.apply {
?")!>this
if (this != null) {
? & kotlin.Number & kotlin.Comparable")!>this
? & kotlin.Number & kotlin.Comparable")!>this.equals(null)
? & kotlin.Number & kotlin.Comparable")!>this.propT
? & kotlin.Number & kotlin.Comparable")!>this.propAny
? & kotlin.Number & kotlin.Comparable")!>this.propNullableT
? & kotlin.Number & kotlin.Comparable")!>this.propNullableAny
? & kotlin.Number & kotlin.Comparable")!>this.funT()
? & kotlin.Number & kotlin.Comparable")!>this.funAny()
? & kotlin.Number & kotlin.Comparable")!>this.funNullableT()
? & kotlin.Number & kotlin.Comparable")!>this.funNullableAny()
}
}.let {
?")!>it
if (it != null) {
? & kotlin.Number & kotlin.Comparable")!>it
? & kotlin.Number & kotlin.Comparable")!>it.equals(null)
? & kotlin.Number & kotlin.Comparable")!>it.propT
? & kotlin.Number & kotlin.Comparable")!>it.propAny
? & kotlin.Number & kotlin.Comparable")!>it.propNullableT
? & kotlin.Number & kotlin.Comparable")!>it.propNullableAny
? & kotlin.Number & kotlin.Comparable")!>it.funT()
? & kotlin.Number & kotlin.Comparable")!>it.funAny()
? & kotlin.Number & kotlin.Comparable")!>it.funNullableT()
? & kotlin.Number & kotlin.Comparable")!>it.funNullableAny()
}
}
}
/*
* TESTCASE NUMBER: 4
* ISSUES: KT-28670
*/
fun case_4(a: Interface1?, b: Interface2?, c: Boolean) {
a as Interface2?
b as Interface1?
val x = when (c) {
true -> a
false -> b
}
x.apply {
this
if (this != null) {
this
this.equals(null)
this.propT
this.propAny
this.propNullableT
this.propNullableAny
this.funT()
this.funAny()
this.funNullableT()
this.funNullableAny()
}
}
x.let {
it
if (it != null) {
it
it.equals(null)
it.propT
it.propAny
it.propNullableT
it.propNullableAny
it.funT()
it.funAny()
it.funNullableT()
it.funNullableAny()
}
}
}
/*
* TESTCASE NUMBER: 5
* ISSUES: KT-28670
*/
fun case_5(a: Interface1?, b: Interface2?, d: Boolean) {
a as Interface2?
b as Interface1
val x = when (d) {
true -> a
false -> b
}
x.apply {
if (this != null) {
this
this.equals(null)
this.propT
this.propAny
this.propNullableT
this.propNullableAny
this.funT()
this.funAny()
this.funNullableT()
this.funNullableAny()
}
}
x.let {
if (it != null) {
it
it.equals(null)
it.propT
it.propAny
it.propNullableT
it.propNullableAny
it.funT()
it.funAny()
it.funNullableT()
it.funNullableAny()
}
}
}
/*
* TESTCASE NUMBER: 6
* ISSUES: KT-28670
*/
fun case_6(a: Interface1?, b: Interface2, d: Boolean) {
a as Interface2?
b as Interface1
val x = when (d) {
true -> a
false -> b
}
x.apply {
this as Interface3
this
if (this != null) {
this
this.equals(null)
this.propT
this.propAny
this.propNullableT
this.propNullableAny
this.funT()
this.funAny()
this.funNullableT()
this.funNullableAny()
this.itest1()
this.itest2()
}
}
x.let {
it as Interface3
it
if (it != null) {
it
it.equals(null)
it.propT
it.propAny
it.propNullableT
it.propNullableAny
it.funT()
it.funAny()
it.funNullableT()
it.funNullableAny()
it.itest1()
it.itest2()
}
}
}
/*
* TESTCASE NUMBER: 7
* ISSUES: KT-28670
*/
fun case_7(a: Interface1?, b: Interface2?, d: Boolean) {
a as Interface2?
b as Interface1?
val x = when (d) {
true -> a
false -> b
}
x.apply {
this as Interface3?
this
if (this != null) {
this
this.equals(null)
this.propT
this.propAny
this.propNullableT
this.propNullableAny
this.funT()
this.funAny()
this.funNullableT()
this.funNullableAny()
this.itest1()
this.itest2()
}
}
x.let {
it as Interface3?
it
if (it != null) {
it
it.equals(null)
it.propT
it.propAny
it.propNullableT
it.propNullableAny
it.funT()
it.funAny()
it.funNullableT()
it.funNullableAny()
it.itest1()
it.itest2()
}
}
}