UnreachableCode.getUnreachableTextRanges always returns at least one range #KT-14158 Fixed
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
$TESTDATA_DIR$/returnAsWhenKey.kt
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
@@ -0,0 +1,7 @@
|
||||
// KT-14158: NoSuchElementException while compiling...
|
||||
|
||||
fun foo(): Int {
|
||||
when (true) {
|
||||
return 0 -> return 1
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
compiler/testData/cli/jvm/returnAsWhenKey.kt:5:17: warning: unreachable code
|
||||
return 0 -> return 1
|
||||
^
|
||||
compiler/testData/cli/jvm/returnAsWhenKey.kt:5:21: warning: unreachable code
|
||||
return 0 -> return 1
|
||||
^
|
||||
OK
|
||||
Reference in New Issue
Block a user