[FIR] Enhance equality smartcasting test case to include data classes
^KT-58169 Fixed
This commit is contained in:
+2
-28
@@ -1,3 +1,5 @@
|
||||
// SKIP_TXT
|
||||
|
||||
fun foo(x: String?) = x
|
||||
|
||||
class Test
|
||||
@@ -23,31 +25,3 @@ fun gav(i: TestWithEquals?, j: TestWithEquals?) {
|
||||
if (i == <!DEBUG_INFO_CONSTANT!>j<!>) foo(<!DEBUG_INFO_CONSTANT!>i<!>)
|
||||
}
|
||||
}
|
||||
|
||||
fun string(foo: Any) {
|
||||
val string = ""
|
||||
if ("" == foo) <!DEBUG_INFO_SMARTCAST!>foo<!>.length
|
||||
if (string == foo) <!DEBUG_INFO_SMARTCAST!>foo<!>.length
|
||||
if (foo == "") foo.<!UNRESOLVED_REFERENCE!>length<!>
|
||||
}
|
||||
|
||||
fun int(foo: Any) {
|
||||
val int = 1
|
||||
if (1 == foo) foo.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>plus<!>(1)
|
||||
if (int == foo) foo.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>plus<!>(1)
|
||||
if (foo == 1) foo.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>plus<!>(1)
|
||||
}
|
||||
|
||||
fun long(foo: Any) {
|
||||
val long = 1L
|
||||
if (1L == foo) foo.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>plus<!>(1L)
|
||||
if (long == foo) foo.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>plus<!>(1L)
|
||||
if (foo == 1L) foo.<!UNRESOLVED_REFERENCE_WRONG_RECEIVER!>plus<!>(1L)
|
||||
}
|
||||
|
||||
fun char(foo: Any) {
|
||||
val char = 'a'
|
||||
if ('a' == foo) foo.<!UNRESOLVED_REFERENCE!>compareTo<!>('a')
|
||||
if (char == foo) foo.<!UNRESOLVED_REFERENCE!>compareTo<!>('a')
|
||||
if (foo == 'a') foo.<!UNRESOLVED_REFERENCE!>compareTo<!>('a')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user