Add intention to specify all types explicitly in destructuring assignment
#KT-16260 Fixed
This commit is contained in:
committed by
Dmitry Jemerov
parent
3529d61a7d
commit
6b2c22aff1
+1
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.idea.intentions.SpecifyTypeExplicitlyInDestructuringAssignmentIntention
|
||||
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
val map = mapOf(1 to "two")
|
||||
for (<caret>(key, value) in map) {
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
val map = mapOf(1 to "two")
|
||||
for ((key: Int, value: String<caret>) in map) {
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
val list = emptyList<Pair<Int, String>>()
|
||||
list.forEach { (i, s)<caret> ->
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
val list = emptyList<Pair<Int, String>>()
|
||||
list.forEach { (i: Int, s: String)<caret> ->
|
||||
}
|
||||
}
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
val list = emptyList<Pair<Int, String>>()
|
||||
list.forEach { (i, s)<caret>: Pair<Int, String> ->
|
||||
}
|
||||
}
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
val list = emptyList<Pair<Int, String>>()
|
||||
list.forEach { (i: Int, s: String)<caret>: Pair<Int, String> ->
|
||||
}
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// IS_APPLICABLE: false
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
val (i: Int, s: String)<caret> = Pair(1, "s")
|
||||
}
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
val (i, s)<caret> = Pair(1, "s")
|
||||
}
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
val (i: Int, s: String<caret>) = Pair(1, "s")
|
||||
}
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
val (i: Int, s) <caret>= Pair(1, "s")
|
||||
}
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
val (i: Int, s: String<caret>) = Pair(1, "s")
|
||||
}
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
val (_, s) =<caret> Pair(1, "s")
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// WITH_RUNTIME
|
||||
fun test() {
|
||||
val (_: Int, s: String<caret>) = Pair(1, "s")
|
||||
}
|
||||
Reference in New Issue
Block a user