Redundant lambda arrow: fix false positive in 'when/if' without block #KT-28047 Fixed

This commit is contained in:
Toshiaki Kameyama
2018-11-08 12:05:46 +09:00
committed by Mikhail Glukhikh
parent 0bfcfb5716
commit 4ae837e669
11 changed files with 102 additions and 0 deletions
@@ -0,0 +1,4 @@
// PROBLEM: none
fun test(): (Int) -> Int {
return if (true) { _ -> 42 } else { <caret>_ -> 42 }
}
@@ -0,0 +1,7 @@
fun test(): (Int) -> Int {
return if (true) {
{ _ -> 42 }
} else {
{ <caret>_ -> 42 }
}
}
@@ -0,0 +1,7 @@
fun test(): (Int) -> Int {
return if (true) {
{ _ -> 42 }
} else {
{ 42 }
}
}
@@ -0,0 +1,4 @@
// PROBLEM: none
fun test(): (Int) -> Int {
return if (true) { <caret>_ -> 42 } else { _ -> 42 }
}
@@ -0,0 +1,7 @@
fun test(): (Int) -> Int {
return if (true) {
{ <caret>_ -> 42 }
} else {
{ _ -> 42 }
}
}
@@ -0,0 +1,7 @@
fun test(): (Int) -> Int {
return if (true) {
{ 42 }
} else {
{ _ -> 42 }
}
}
@@ -0,0 +1,7 @@
// PROBLEM: none
fun test(): (Int) -> Int {
return when {
true -> { <caret>_ -> 42 }
else -> { _ -> 42 }
}
}
@@ -0,0 +1,10 @@
fun test(): (Int) -> Int {
return when {
true -> {
{ <caret>_ -> 42 }
}
else -> {
{ _ -> 42 }
}
}
}
@@ -0,0 +1,10 @@
fun test(): (Int) -> Int {
return when {
true -> {
{ 42 }
}
else -> {
{ _ -> 42 }
}
}
}