Extract Function: Utilize pseudo-value usage for return type inference
This commit is contained in:
+13
@@ -0,0 +1,13 @@
|
||||
// SIBLING:
|
||||
fun foo(a: Int): Int {
|
||||
val b: Int = 1
|
||||
return i(a, b)
|
||||
}
|
||||
|
||||
fun i(a: Int, b: Int): Int {
|
||||
return when (a + b) {
|
||||
0 -> b
|
||||
1 -> -b
|
||||
else -> a - b
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user