"Replace 'when' with 'if'" intention: do not suggest if 'when' subject is variable declaration
#KT-35528 Fixed
This commit is contained in:
committed by
Dmitry Gridin
parent
1cdcef3b08
commit
49e5f170d1
@@ -0,0 +1,13 @@
|
||||
// IS_APPLICABLE: false
|
||||
enum class Type {
|
||||
HYDRO,
|
||||
PYRO
|
||||
}
|
||||
|
||||
fun select(t: Type): Int {
|
||||
return <caret>when (val i = t.ordinal) {
|
||||
0 -> 1
|
||||
1 -> 42
|
||||
else -> i
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user