Refactored ConvertMemberToExtension to re-use original declaration instead of regenerating it by text

#KT-4920 Fixed
This commit is contained in:
Valentin Kipyatkov
2015-05-12 11:31:06 +03:00
parent ac9d75b45e
commit 48ac89dca4
19 changed files with 124 additions and 113 deletions
@@ -0,0 +1,8 @@
class Foo
{
/**
* Doc
*/
public val <caret>count: Int
get() = 1
}
@@ -0,0 +1,9 @@
class Foo
{
}
/**
* Doc
*/
public val Foo.<caret>count: Int
get() = 1
@@ -1,5 +1,4 @@
class Owner {
}
fun Owner.f(): Unit {
}
fun Owner.f(): Unit {}
@@ -1,4 +1,4 @@
abstract class Owner<T> {
}
fun <T, R> Owner<T>.f(t: T, r: R): R = r
fun Owner<T>.f<T, R>(t: T, r: R): R = r
@@ -1,4 +1,4 @@
abstract class Owner {
}
fun <T> Owner.f(t: T): T = t
fun Owner.f<T>(t: T): T = t
@@ -1,5 +1,4 @@
class Owner {
}
fun Owner.f() {
}
fun Owner.f() {}
@@ -2,4 +2,4 @@ class Owner {
}
val Owner.p: Int
get() = 1
get() = 1
@@ -1,4 +1,4 @@
class Owner {
val <caret>p: Int
get() { return 1}
get() { return 1}
}
@@ -2,6 +2,4 @@ class Owner {
}
val Owner.p: Int
get() {
return 1
}
get() { return 1}
@@ -1,6 +1,6 @@
// ERROR: Property must be initialized
class Owner {
var <caret>p: Int
get() = 1
set
get() = 1
set
}
@@ -1,5 +1,5 @@
// ERROR: Property must be initialized
class Owner {
var <caret>p: Int
get() { return 1 }
get() { return 1 }
}
@@ -3,9 +3,7 @@ class Owner {
}
var Owner.p: Int
get() {
return 1
}
get() { return 1 }
set(value) {
<caret><selection>throw UnsupportedOperationException()</selection>
}
@@ -2,6 +2,5 @@ class Owner {
}
var Owner.p: Int
get() = 1
set(v) {
}
get() = 1
set(v) {}
@@ -4,5 +4,4 @@ class Owner {
var Owner.p: Int
get() = <caret><selection>throw UnsupportedOperationException()</selection>
set(v) {
}
set(v) {}
@@ -1,6 +1,4 @@
class Owner {
}
fun Owner.f(): Int {
return 1
}
fun Owner.f(): Int { return 1 }