Extract Function: Limit the set of allowed containers for the default action
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
class A {
|
||||
fun foo(a: Int, b: Int): Int {
|
||||
return object: Function0<Int> {
|
||||
override fun invoke(): Int {
|
||||
return i()
|
||||
}
|
||||
|
||||
fun i(): Int {
|
||||
return a + b - 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user