Front-end fix: result type corrected for increment / decrement expressions. Smart cast allowed on a postfix increment result. See KT-7561.
Now result type is receiver type for postfix increment, or increment result type for prefix increment. A set of relevant tests.
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
fun Int?.inc(): Int? { return this }
|
||||
|
||||
public fun box(arg: Int?) : Int? {
|
||||
var i = arg
|
||||
var j = ++i
|
||||
j<!UNSAFE_CALL!>.<!>toInt()
|
||||
return ++j
|
||||
}
|
||||
Reference in New Issue
Block a user