[NI] Add restored smart casts to spec tests
KT-35668 Fixed
This commit is contained in:
@@ -46,8 +46,8 @@ fun case_2(x: Int?, y: Nothing?) {
|
||||
fun case_3(x: Int?) {
|
||||
if (x == null) {
|
||||
<!ALWAYS_NULL!>x<!> as Int
|
||||
<!UNREACHABLE_CODE!>stringArg(<!><!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing"), DEBUG_INFO_SMARTCAST!>x<!><!UNREACHABLE_CODE!>)<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Int? & kotlin.Nothing"), UNREACHABLE_CODE!>x<!>
|
||||
stringArg(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Int? & kotlin.Nothing"), DEBUG_INFO_SMARTCAST!>x<!>)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Int? & kotlin.Nothing")!>x<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ fun case_3(x: Int?) {
|
||||
fun case_4(x: Int?) {
|
||||
if (x == null) {
|
||||
<!ALWAYS_NULL!>x<!>!!
|
||||
<!UNREACHABLE_CODE!>stringArg(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing"), DEBUG_INFO_SMARTCAST!>x<!>)<!>
|
||||
<!UNREACHABLE_CODE!>stringArg(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Int? & kotlin.Nothing"), DEBUG_INFO_SMARTCAST!>x<!>)<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Int? & kotlin.Nothing"), UNREACHABLE_CODE!>x<!>
|
||||
}
|
||||
}
|
||||
@@ -73,7 +73,7 @@ fun case_5(x: Int?) {
|
||||
if (x == null) {
|
||||
var y = <!DEBUG_INFO_CONSTANT!>x<!>
|
||||
<!ALWAYS_NULL!>y<!>!!
|
||||
<!UNREACHABLE_CODE!>stringArg(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int? & kotlin.Nothing"), DEBUG_INFO_SMARTCAST!>y<!>)<!>
|
||||
<!UNREACHABLE_CODE!>stringArg(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Int? & kotlin.Nothing"), DEBUG_INFO_SMARTCAST!>y<!>)<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Int? & kotlin.Nothing"), UNREACHABLE_CODE!>y<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
fun <T: Any, K: Any> case_1(x: T?, y: K?) {
|
||||
x as T
|
||||
y as K
|
||||
val z = <!DEBUG_INFO_EXPRESSION_TYPE("T & T!! & T?")!>x<!> <!USELESS_ELVIS!>?: <!DEBUG_INFO_EXPRESSION_TYPE("K & K?"), DEBUG_INFO_SMARTCAST!>y<!><!>
|
||||
val z = <!DEBUG_INFO_EXPRESSION_TYPE("T & T!! & T?")!>x<!> <!USELESS_ELVIS!>?: <!DEBUG_INFO_EXPRESSION_TYPE("K & K!! & K?"), DEBUG_INFO_SMARTCAST!>y<!><!>
|
||||
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("T & T?"), DEBUG_INFO_SMARTCAST!>x<!>.equals(10)
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any")!>z<!>
|
||||
|
||||
@@ -62,8 +62,8 @@ fun case_5(x: Any?) {
|
||||
*/
|
||||
fun case_6(x: Any?) {
|
||||
if (x is Boolean? && <!DEBUG_INFO_SMARTCAST!>x<!>!!) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Boolean?")!>x<!><!UNSAFE_CALL!>.<!>not()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean?")!>select(<!DEBUG_INFO_SMARTCAST!>x<!>)<!><!UNSAFE_CALL!>.<!>not()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Boolean"), DEBUG_INFO_SMARTCAST!>x<!>.not()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Boolean")!>select(<!DEBUG_INFO_SMARTCAST!>x<!>)<!>.not()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -361,7 +361,7 @@ fun case_15(x: Any?) {
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 16
|
||||
fun case_16(a: Any?, b: Int = if (a is Number? && a is Int? && a !== null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Int"), DEBUG_INFO_SMARTCAST!>a<!> else 0) {
|
||||
fun case_16(a: Any?, b: Int = if (a is Number? && a is Int? && a !== null) <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & kotlin.Any? & kotlin.Int & kotlin.Number"), DEBUG_INFO_SMARTCAST!>a<!> else 0) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>a<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>b<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>b<!>.equals(null)
|
||||
@@ -376,7 +376,7 @@ fun case_16(a: Any?, b: Int = if (a is Number? && a is Int? && a !== null) <!DEB
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 17
|
||||
fun case_17(a: Any?, b: Int = if (a !is Number? || a !is Int? || a == null) 0 else <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Int"), DEBUG_INFO_SMARTCAST!>a<!>) {
|
||||
fun case_17(a: Any?, b: Int = if (a !is Number? || a !is Int? || a == null) 0 else <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & kotlin.Any? & kotlin.Int & kotlin.Number"), DEBUG_INFO_SMARTCAST!>a<!>) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>a<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>b<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>b<!>.equals(null)
|
||||
|
||||
@@ -29,7 +29,7 @@ fun case_1(x: Any) {
|
||||
fun case_2(x: Any?) {
|
||||
if (x is String?) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String")!><!DEBUG_INFO_SMARTCAST!>x<!>!!<!>.length
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.String?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & kotlin.Any? & kotlin.String")!>x<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,6 +51,6 @@ fun case_3(x: Any) {
|
||||
fun case_4(x: Any?) {
|
||||
if (x is Map.Entry<*, *>?) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.Map.Entry<*, *>")!><!DEBUG_INFO_SMARTCAST!>x<!>!!<!>.value
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.collections.Map.Entry<*, *>?")!>x<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & kotlin.Any? & kotlin.collections.Map.Entry<*, *>")!>x<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1405,14 +1405,14 @@ fun case_75(t: Any?, z: Nothing?) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("Interface1 & kotlin.Any?"), DEBUG_INFO_SMARTCAST!>t<!>.itest()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("ClassLevel2 & kotlin.Any?"), DEBUG_INFO_SMARTCAST!>t<!>.test1()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("ClassLevel2 & kotlin.Any?"), DEBUG_INFO_SMARTCAST!>t<!>.test2()
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("ClassLevel2 & kotlin.Any?"), DEBUG_INFO_SMARTCAST!>t<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("ClassLevel1 & ClassLevel2 & Interface1 & Interface2 & Interface3 & kotlin.Any & kotlin.Any?"), DEBUG_INFO_SMARTCAST!>t<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TESTCASE NUMBER: 76
|
||||
fun case_76(a: Any?, b: Int = if (<!DEPRECATED_IDENTITY_EQUALS!>a !is Number? === true<!> || a !is Int? == true || a != null == false == true) 0 else <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any? & kotlin.Int"), DEBUG_INFO_SMARTCAST!>a<!>) {
|
||||
fun case_76(a: Any?, b: Int = if (<!DEPRECATED_IDENTITY_EQUALS!>a !is Number? === true<!> || a !is Int? == true || a != null == false == true) 0 else <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & kotlin.Any? & kotlin.Int"), DEBUG_INFO_SMARTCAST!>a<!>) {
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>a<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>b<!>
|
||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>b<!>.equals(null)
|
||||
|
||||
Reference in New Issue
Block a user