Join with assignment: place the result at the assignment

#KT-21172 Fixed
This commit is contained in:
Toshiaki Kameyama
2019-09-26 12:51:34 +03:00
committed by Mikhail Glukhikh
parent 8078c5da40
commit 40dd229021
14 changed files with 128 additions and 9 deletions
@@ -0,0 +1,9 @@
fun test(repo: Repository, commitMessage: String) {
val hash: String<caret>
repo.git("add --verbose .")
hash = repo.git("commit -m $commitMessage")
}
class Repository {
fun git(s: String) = ""
}
@@ -0,0 +1,8 @@
fun test(repo: Repository, commitMessage: String) {
repo.git("add --verbose .")
val hash<selection>: String</selection><caret> = repo.git("commit -m $commitMessage")
}
class Repository {
fun git(s: String) = ""
}
@@ -0,0 +1,9 @@
class A {
constructor() {
val foo: String<caret>
bar()
foo = ""
}
fun bar() {}
}
@@ -0,0 +1,8 @@
class A {
constructor() {
bar()
val foo<selection>: String</selection><caret> = ""
}
fun bar() {}
}
@@ -0,0 +1,9 @@
class A {
init {
val foo: String<caret>
bar()
foo = ""
}
fun bar() {}
}
@@ -0,0 +1,8 @@
class A {
init {
bar()
val foo<selection>: String</selection><caret> = ""
}
fun bar() {}
}
@@ -0,0 +1,7 @@
class A {
constructor() {
a = 1
}
val a<caret>: Int
}
@@ -0,0 +1,5 @@
class A {
constructor()
val a<selection>: Int</selection><caret> = 1
}
@@ -0,0 +1,8 @@
// DISABLE-ERRORS
class A(i: Int, j: Int) {
constructor(i: Int) : this(i, 2) {
a = 1
}
val a<caret>: Int
}
@@ -0,0 +1,6 @@
// DISABLE-ERRORS
class A(i: Int, j: Int) {
constructor(i: Int) : this(i, 2)
val a<selection>: Int</selection><caret> = 1
}
@@ -1,7 +1,10 @@
class A {
constructor() {
a = 1
foo()
}
val a<caret>: Int
fun foo() {}
}
@@ -1,6 +1,9 @@
class A {
constructor() {
foo()
}
val a<selection>: Int</selection><caret> = 1
fun foo() {}
}