Control-Flow Analysis: Reuse pseudo-value information for unused expression analysis
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
fun nonlocals(b : Boolean) {
|
||||
@a{(): Int ->
|
||||
@a<!UNUSED_FUNCTION_LITERAL!>{(): Int ->
|
||||
fun foo() {
|
||||
if (b) {
|
||||
<!RETURN_NOT_ALLOWED!>return@a 1<!> // The label must be resolved, but an error should be reported for a non-local return
|
||||
@@ -7,6 +7,5 @@ fun nonlocals(b : Boolean) {
|
||||
}
|
||||
|
||||
return@a 5
|
||||
}
|
||||
}
|
||||
|
||||
}<!>
|
||||
}
|
||||
+3
-3
@@ -15,11 +15,11 @@ fun B.b() {
|
||||
}
|
||||
|
||||
fun test() {
|
||||
@b { B.() ->
|
||||
@b <!UNUSED_FUNCTION_LITERAL!>{ B.() ->
|
||||
object : A {
|
||||
override fun foo() {
|
||||
this@b.bar()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}<!>
|
||||
}
|
||||
Reference in New Issue
Block a user