Convert "lift return / assignment" intentions into a single inspection
Also includes minor test fix, related to KT-14900
This commit is contained in:
committed by
Mikhail Glukhikh
parent
8f33bd0768
commit
2d1abda9a1
@@ -0,0 +1,13 @@
|
||||
fun foo(): Int {
|
||||
var res = 0
|
||||
loop@ while (true) {
|
||||
res += when (1) {
|
||||
1 -> 1
|
||||
2 -> throw Exception()
|
||||
3 -> break@loop
|
||||
4 -> continue@loop
|
||||
else -> return -1
|
||||
}
|
||||
}
|
||||
return res
|
||||
}
|
||||
Reference in New Issue
Block a user