Data flow values: more accurate handling of postfix ++ and --
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
fun foo(arg: Int?): Int {
|
||||
var i = arg
|
||||
if (i != null && <!DEBUG_INFO_SMARTCAST!>i<!>++ == 5) {
|
||||
return <!DEBUG_INFO_SMARTCAST!><!DEBUG_INFO_SMARTCAST!>i<!>--<!> + <!DEBUG_INFO_SMARTCAST!>i<!>
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
operator fun Long?.inc() = this?.let { it + 1 }
|
||||
|
||||
fun bar(arg: Long?): Long {
|
||||
var i = arg
|
||||
if (i++ == 5L) {
|
||||
return i<!UNSAFE_CALL!>--<!> <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>+<!> i
|
||||
}
|
||||
if (i++ == 7L) {
|
||||
return i++ <!NONE_APPLICABLE!>+<!> i
|
||||
}
|
||||
return 0L
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
package
|
||||
|
||||
public fun bar(/*0*/ arg: kotlin.Long?): kotlin.Long
|
||||
public fun foo(/*0*/ arg: kotlin.Int?): kotlin.Int
|
||||
public operator fun kotlin.Long?.inc(): kotlin.Long?
|
||||
Reference in New Issue
Block a user