KT-22274 report warning on labels that can't be referenced
Labels are meaningful only if they can be referenced by 'break', 'continue', or 'return' expressions.
This commit is contained in:
+2
-2
@@ -14,7 +14,7 @@ fun test(bar: Bar, a: A) {
|
||||
// no elements with error types
|
||||
fooInt((bar()))
|
||||
fooInt(if (true) bar() else bar())
|
||||
fooInt(label@ bar())
|
||||
fooInt(<!REDUNDANT_LABEL_WARNING!>label@<!> bar())
|
||||
fooInt(a.bar())
|
||||
fooInt(((label@ if (true) (a.bar()) else bar())))
|
||||
fooInt(((<!REDUNDANT_LABEL_WARNING!>label@<!> if (true) (a.bar()) else bar())))
|
||||
}
|
||||
Reference in New Issue
Block a user