Drop UNREACHABLE_CODE eager text range calculation

#KT-35242 Fixed
This commit is contained in:
Vladimir Dolzhenko
2019-12-04 17:47:21 +01:00
parent 9e4d7df86e
commit 272ca002d7
19 changed files with 321 additions and 126 deletions
+17
View File
@@ -0,0 +1,17 @@
// SCOPE: '// some change'
class Comment {
fun q() {
}
val someValue: String
get() {
return "X"
}
fun baa() {
<selection>// some change</selection>
val list = listOf<String>(TODO(""))
}
}
+18
View File
@@ -0,0 +1,18 @@
// SCOPE: 'fun baa() {'
// SCOPE: ' val list = listOf<String>("Z")'
// SCOPE: ' }'
class Comment {
fun q() {
}
val someValue: String
get() {
return "X"
}
fun baa() {
val list = listOf<String>(<selection>"Z"</selection>)
}
}
@@ -1,5 +1,7 @@
// OUT_OF_CODE_BLOCK: FALSE
// ERROR: Unresolved reference: awhen
// OUT_OF_CODE_BLOCK: TRUE
// TYPE: 'z'
// ERROR: Unresolved reference: zwhen
enum class A {
e1, e2, e3
}
@@ -12,4 +14,7 @@ val B.foo: Int
A.e1 -> 1
A.e2 -> 4
}
}
}
// TODO: Investigate
// SKIP_ANALYZE_CHECK
@@ -0,0 +1,11 @@
// OUT_OF_CODE_BLOCK: FALSE
// TYPE: '1'
// ENABLE-WARNINGS
// WARNING: Unreachable code
fun test() {
return
val a = <caret>
}
@@ -1,4 +1,4 @@
// OUT_OF_CODE_BLOCK: FALSE
// OUT_OF_CODE_BLOCK: TRUE
// TYPE: '//'
// ERROR: Property must be initialized
@@ -6,4 +6,7 @@ var prop1: Int
set(value) {
<caret> println("prop.setter")
field = value
}
}
// TODO: Investigate
// SKIP_ANALYZE_CHECK