Can be constructor property: comment saver introduced to retain comments; unbound comments now added before, not after

(cherry picked from commit 886cf21)
This commit is contained in:
Mikhail Glukhikh
2016-06-20 20:12:47 +03:00
committed by Mikhail Glukhikh
parent 4145e3438f
commit 4abcc278fd
10 changed files with 43 additions and 4 deletions
@@ -2,7 +2,8 @@
// WITH_RUNTIME
fun foo(p: Array<String?>) {
val v = p[0]!!<caret>/* null */
/* null */
val v = p[0]!!
// now let's check it for null
// 'v' should not be null
}
@@ -1,4 +1,5 @@
// "Remove function body" "true"
abstract class A() {
<caret>abstract fun foo() // 3/*1*/
/*1*/
abstract fun foo() // 3
}
@@ -0,0 +1,4 @@
// "Move to constructor" "true"
class Complex(x: Int, y: Double, z: String) {
val <caret>y: Double = y // Duplicating
}
@@ -0,0 +1,4 @@
// "Move to constructor" "true"
class Complex(x: Int, // Duplicating
val y: Double, z: String) {
}
@@ -0,0 +1,7 @@
// "Move to constructor" "true"
class Complex(x: Int, y: Double, z: String) {
/**
* Very complex field x
*/
val <caret>x = x
}
@@ -0,0 +1,7 @@
// "Move to constructor" "true"
class Complex(
/**
* Very complex field x
*/
val x: Int, y: Double, z: String) {
}
@@ -8,5 +8,5 @@ fun oldFun(p: Int) {
fun newFun(){}
fun foo() {
newFun()/* use zero */
/* use zero */newFun()
}