Redundant lambda arrow: fix false positive in 'when/if' without block #KT-28047 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
0bfcfb5716
commit
4ae837e669
@@ -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 }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user