Introduce Property: Initial support (properties with getter)

This commit is contained in:
Alexey Sedunov
2015-03-04 18:01:06 +03:00
parent 48914e70ff
commit 03fada71d7
36 changed files with 396 additions and 158 deletions
@@ -1,10 +0,0 @@
// EXTRACT_AS_PROPERTY
class A(val n: Int = 1) {
val m: Int = 2
// SIBLING:
fun foo(): Int {
return <selection>m + n + 1</selection>
}
}
@@ -1,15 +0,0 @@
// EXTRACT_AS_PROPERTY
class A(val n: Int = 1) {
val m: Int = 2
// SIBLING:
fun foo(): Int {
return i
}
private val i: Int
get() {
return m + n + 1
}
}
@@ -1,8 +0,0 @@
// EXTRACT_AS_PROPERTY
val n: Int = 1
// SIBLING:
fun foo(): Int {
return <selection>n + 1</selection>
}
@@ -1,13 +0,0 @@
// EXTRACT_AS_PROPERTY
val n: Int = 1
// SIBLING:
fun foo(): Int {
return i
}
private val i: Int
get() {
return n + 1
}
@@ -1,6 +0,0 @@
// EXTRACT_AS_PROPERTY
fun foo(n: Int): Int {
// SIBLING:
return {<selection>n + 1</selection>}()
}
@@ -1 +0,0 @@
Can't generate property: n + 1
@@ -1,5 +0,0 @@
// EXTRACT_AS_PROPERTY
// SIBLING:
fun foo() {
<selection>1 + 1</selection>
}
@@ -1 +0,0 @@
Can't generate property: 1 + 1
@@ -1,11 +0,0 @@
// PARAM_TYPES: kotlin.Int
// PARAM_DESCRIPTOR: val m: kotlin.Int defined in foo
// EXTRACT_AS_PROPERTY
val n: Int = 1
// SIBLING:
fun foo(): Int {
val m = 1
return <selection>n + m + 1</selection>
}
@@ -1 +0,0 @@
Can't generate property: n + m + 1
@@ -1,5 +1,5 @@
// WITH_RUNTIME
// OPTIONS: true, true, false
// OPTIONS: true, true, false, false
// PARAM_TYPES: kotlin.Int
// PARAM_TYPES: kotlin.Int
// PARAM_TYPES: kotlin.Int
@@ -1,5 +1,5 @@
// WITH_RUNTIME
// OPTIONS: true, true, false
// OPTIONS: true, true, false, false
// PARAM_TYPES: kotlin.Int
// PARAM_TYPES: kotlin.Int
// PARAM_TYPES: kotlin.Int