Extract Function: Extract smart-cast value as parameter
#KT-7576 Fixed
This commit is contained in:
+17
@@ -0,0 +1,17 @@
|
||||
// WITH_RUNTIME
|
||||
// SUGGESTED_NAMES: i, getKm
|
||||
// PARAM_TYPES: kotlin.Int
|
||||
// PARAM_DESCRIPTOR: internal final val meters: kotlin.Int? defined in A
|
||||
class A {
|
||||
val meters: Int? = 1
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val a = A()
|
||||
with (a) {
|
||||
if (meters == null) return
|
||||
val km = i(meters)
|
||||
}
|
||||
}
|
||||
|
||||
private fun i(meters: Int) = meters / 10
|
||||
Reference in New Issue
Block a user