Extract Function: Support extraction of expressions in delegation

specifiers
This commit is contained in:
Alexey Sedunov
2014-06-27 20:41:08 +04:00
parent 1c75a5f642
commit 09a1a8ce8f
8 changed files with 77 additions and 3 deletions
@@ -0,0 +1,7 @@
// PARAM_TYPES: kotlin.Int
// PARAM_TYPES: kotlin.Int
trait T
class A(a: Int, b: Int): T
class B(a: Int, b: Int): T by A(<selection>a + b</selection>, a - b)
@@ -0,0 +1,11 @@
// PARAM_TYPES: kotlin.Int
// PARAM_TYPES: kotlin.Int
trait T
class A(a: Int, b: Int): T
class B(a: Int, b: Int): T by A(i(a, b), a - b)
fun i(a: Int, b: Int): Int {
return a + b
}
@@ -0,0 +1,6 @@
// PARAM_TYPES: T
trait T
class A(a: Int, b: Int): T
class B(t: T): T by <selection>t</selection>
@@ -0,0 +1,10 @@
// PARAM_TYPES: T
trait T
class A(a: Int, b: Int): T
class B(t: T): T by t(t)
fun t(t: T): T {
return t
}
@@ -0,0 +1,5 @@
// PARAM_TYPES: kotlin.Int
// PARAM_TYPES: kotlin.Int
open class A(a: Int, b: Int)
class B(a: Int, b: Int): A(<selection>a + b</selection>, a - b)
@@ -0,0 +1,9 @@
// PARAM_TYPES: kotlin.Int
// PARAM_TYPES: kotlin.Int
open class A(a: Int, b: Int)
class B(a: Int, b: Int): A(i(a, b), a - b)
fun i(a: Int, b: Int): Int {
return a + b
}