From df6d4f358ad388fe6512b264111f821e4e8f4845 Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Tue, 24 Jul 2018 15:58:10 +0300 Subject: [PATCH] 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. --- .../kotlin/cfg/ControlFlowProcessor.kt | 11 ++++++ .../jetbrains/kotlin/diagnostics/Errors.java | 2 + .../rendering/DefaultErrorMessages.java | 2 + .../diagnostics/tests/BreakContinue.kt | 4 +- compiler/testData/diagnostics/tests/Casts.kt | 2 +- .../tests/FunctionCalleeExpressions.kt | 2 +- .../diagnostics/tests/LValueAssignment.kt | 10 ++--- .../tests/PackageInExpressionPosition.kt | 2 +- .../diagnostics/tests/ReserveYield2.kt | 4 +- .../testData/diagnostics/tests/Underscore.kt | 2 +- .../deadCode/commentsInDeadCode.kt | 2 +- .../referenceToPropertyInitializer.kt | 2 +- .../notAFunctionLabel_after.kt | 4 +- .../notAFunctionLabel_before.kt | 4 +- .../tests/controlStructures/redundantLabel.kt | 39 +++++++++++++++++++ .../controlStructures/redundantLabel.txt | 21 ++++++++++ .../inference/labeledDelegatedExpression.kt | 2 +- .../deparenthesize/ParenthesizedVariable.kt | 2 +- .../checkDeparenthesizedType.kt | 10 ++--- .../tests/deparenthesize/labeledSafeCall.kt | 2 +- .../expectedTypeFromCastParenthesized.kt | 2 +- .../diagnostics/tests/inline/labeled.kt | 8 ++-- .../diagnostics/tests/inline/parenthesized.kt | 4 +- .../TypeMismatchOnUnaryOperations.kt | 4 +- .../nestedCalls/argumentsInParentheses.kt | 4 +- .../senselessComparison/parenthesized.kt | 8 ++-- .../checkers/DiagnosticsTestGenerated.java | 5 +++ .../DiagnosticsUsingJavacTestGenerated.java | 5 +++ 28 files changed, 127 insertions(+), 42 deletions(-) create mode 100644 compiler/testData/diagnostics/tests/controlStructures/redundantLabel.kt create mode 100644 compiler/testData/diagnostics/tests/controlStructures/redundantLabel.txt diff --git a/compiler/frontend/src/org/jetbrains/kotlin/cfg/ControlFlowProcessor.kt b/compiler/frontend/src/org/jetbrains/kotlin/cfg/ControlFlowProcessor.kt index 7324ef2f1d2..9f2ee0fd7d4 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/cfg/ControlFlowProcessor.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/cfg/ControlFlowProcessor.kt @@ -298,6 +298,17 @@ class ControlFlowProcessor( generateInstructions(baseExpression) copyValue(baseExpression, expression) } + + val labelNameExpression = expression.getTargetLabel() + if (labelNameExpression != null) { + val deparenthesizedBaseExpression = KtPsiUtil.deparenthesize(expression) + if (deparenthesizedBaseExpression !is KtLambdaExpression && + deparenthesizedBaseExpression !is KtLoopExpression && + deparenthesizedBaseExpression !is KtNamedFunction + ) { + trace.report(Errors.REDUNDANT_LABEL_WARNING.on(labelNameExpression)) + } + } } override fun visitBinaryExpression(expression: KtBinaryExpression) { diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java index 97344c48a0a..182337a178b 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java @@ -822,6 +822,8 @@ public interface Errors { DiagnosticFactory0 NOT_A_FUNCTION_LABEL = DiagnosticFactory0.create(ERROR); DiagnosticFactory0 NOT_A_FUNCTION_LABEL_WARNING = DiagnosticFactory0.create(WARNING); + DiagnosticFactory0 REDUNDANT_LABEL_WARNING = DiagnosticFactory0.create(WARNING); + // Control flow / Data flow DiagnosticFactory1> UNREACHABLE_CODE = DiagnosticFactory1.create( diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java index 6f1982dea51..6119a71fbf8 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java @@ -602,6 +602,8 @@ public class DefaultErrorMessages { MAP.put(NOT_A_FUNCTION_LABEL, "Target label does not denote a function"); MAP.put(NOT_A_FUNCTION_LABEL_WARNING, "Target label does not denote a function"); + MAP.put(REDUNDANT_LABEL_WARNING, "Label is redundant, because it can not be referenced in either ''break'', ''continue'', or ''return'' expression"); + MAP.put(ANONYMOUS_INITIALIZER_IN_INTERFACE, "Anonymous initializers are not allowed in interfaces"); MAP.put(NULLABLE_SUPERTYPE, "A supertype cannot be nullable"); MAP.put(DYNAMIC_SUPERTYPE, "A supertype cannot be dynamic"); diff --git a/compiler/testData/diagnostics/tests/BreakContinue.kt b/compiler/testData/diagnostics/tests/BreakContinue.kt index 333f9ea024b..1916021cae2 100644 --- a/compiler/testData/diagnostics/tests/BreakContinue.kt +++ b/compiler/testData/diagnostics/tests/BreakContinue.kt @@ -2,7 +2,7 @@ class C { fun f (a : Boolean, b : Boolean) { b@ while (true) - a@ { + a@ { break@f break break@b @@ -12,7 +12,7 @@ class C { continue b@ while (true) - a@ { + a@ { continue@f continue continue@b diff --git a/compiler/testData/diagnostics/tests/Casts.kt b/compiler/testData/diagnostics/tests/Casts.kt index e3826b63ff5..96c2679a163 100644 --- a/compiler/testData/diagnostics/tests/Casts.kt +++ b/compiler/testData/diagnostics/tests/Casts.kt @@ -17,7 +17,7 @@ fun test() : Unit { val s = "" as Any ("" as String?)?.length - (data@("" as String?))?.length + (data@("" as String?))?.length (@MustBeDocumented()( "" as String?))?.length Unit } diff --git a/compiler/testData/diagnostics/tests/FunctionCalleeExpressions.kt b/compiler/testData/diagnostics/tests/FunctionCalleeExpressions.kt index 47bdfafefcc..388dc07641e 100644 --- a/compiler/testData/diagnostics/tests/FunctionCalleeExpressions.kt +++ b/compiler/testData/diagnostics/tests/FunctionCalleeExpressions.kt @@ -59,7 +59,7 @@ fun main1() { {1}(); (fun (x : Int) = x)(1) 1.(fun Int.(x : Int) = x)(1); - l@{1}() + l@{1}() 1.((fun Int.() = 1))() 1.(f())() 1.if(true){f()}else{f()}() diff --git a/compiler/testData/diagnostics/tests/LValueAssignment.kt b/compiler/testData/diagnostics/tests/LValueAssignment.kt index b98be9fd2e9..f0d3683c545 100644 --- a/compiler/testData/diagnostics/tests/LValueAssignment.kt +++ b/compiler/testData/diagnostics/tests/LValueAssignment.kt @@ -78,17 +78,17 @@ class Test() { (f@ getInt()) += 343 1++ - (r@ 1)++ + (r@ 1)++ getInt()++ - (m@ getInt())++ + (m@ getInt())++ this++ var s : String = "r" s += "ss" s += this - s += (a@ 2) + s += (a@ 2) } fun testIncompleteSyntax() { @@ -106,7 +106,7 @@ class Test() { b += 34 a++ - (l@ a)++ + (l@ a)++ (a)++ } @@ -126,7 +126,7 @@ class Test() { ab.getArray()[54] = 23 ab.getArray()[54]++ - (f@ a)[3] = 4 + (f@ a)[3] = 4 this[54] = 34 } diff --git a/compiler/testData/diagnostics/tests/PackageInExpressionPosition.kt b/compiler/testData/diagnostics/tests/PackageInExpressionPosition.kt index fe2e2ca4e0c..330b7c424fd 100644 --- a/compiler/testData/diagnostics/tests/PackageInExpressionPosition.kt +++ b/compiler/testData/diagnostics/tests/PackageInExpressionPosition.kt @@ -22,6 +22,6 @@ fun main(args : Array) { System is Int System() (System) - foo@ System + foo@ System null in System } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/ReserveYield2.kt b/compiler/testData/diagnostics/tests/ReserveYield2.kt index 165989407f9..b12cfbdba6a 100644 --- a/compiler/testData/diagnostics/tests/ReserveYield2.kt +++ b/compiler/testData/diagnostics/tests/ReserveYield2.kt @@ -5,8 +5,8 @@ annotation class yield fun bar(p: Int) { - yield@ p - `yield`@ p + yield@ p + `yield`@ p @yield() p @`yield`() p diff --git a/compiler/testData/diagnostics/tests/Underscore.kt b/compiler/testData/diagnostics/tests/Underscore.kt index 0b66374cec2..a67f76ab0e7 100644 --- a/compiler/testData/diagnostics/tests/Underscore.kt +++ b/compiler/testData/diagnostics/tests/Underscore.kt @@ -21,7 +21,7 @@ fun __(___: Int, y: _: String) = 1 - __@ return if (y != null) __(____, y) else __(`_`, ______) + __@ return if (y != null) __(____, y) else __(`_`, ______) } diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/commentsInDeadCode.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/commentsInDeadCode.kt index 315b6b2b8fc..839d543d20b 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/commentsInDeadCode.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/deadCode/commentsInDeadCode.kt @@ -12,7 +12,7 @@ fun test2() { bar(11, todo()/*comment1*/, ""/*comment2*/) } fun test3() { - bar(11, l@(todo()/*comment*/), "") + bar(11, l@(todo()/*comment*/), "") } fun todo(): Nothing = throw Exception() diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/referenceToPropertyInitializer.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/referenceToPropertyInitializer.kt index 56af736b6d0..4e8bca9bdf7 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/referenceToPropertyInitializer.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/referenceToPropertyInitializer.kt @@ -19,7 +19,7 @@ class TestObjectLiteral { val y = obj } } - val obj1: A = l@ ( object: A(obj1) { + val obj1: A = l@ ( object: A(obj1) { init { val x = obj1 } diff --git a/compiler/testData/diagnostics/tests/controlStructures/notAFunctionLabel_after.kt b/compiler/testData/diagnostics/tests/controlStructures/notAFunctionLabel_after.kt index ba4ec6da0e4..52d15ee4e69 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/notAFunctionLabel_after.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/notAFunctionLabel_after.kt @@ -51,12 +51,12 @@ fun testLoopLabelInReturn(xs: List) { } fun testValLabelInReturn() { - L@ val fn = { return@L } + L@ val fn = { return@L } fn() } fun testHighOrderFunctionCallLabelInReturn() { - L@ run { + L@ run { return@L } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/controlStructures/notAFunctionLabel_before.kt b/compiler/testData/diagnostics/tests/controlStructures/notAFunctionLabel_before.kt index 84714135a02..00a174f3a88 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/notAFunctionLabel_before.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/notAFunctionLabel_before.kt @@ -51,12 +51,12 @@ fun testLoopLabelInReturn(xs: List) { } fun testValLabelInReturn() { - L@ val fn = { return@L } + L@ val fn = { return@L } fn() } fun testHighOrderFunctionCallLabelInReturn() { - L@ run { + L@ run { return@L } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/controlStructures/redundantLabel.kt b/compiler/testData/diagnostics/tests/controlStructures/redundantLabel.kt new file mode 100644 index 00000000000..06267698864 --- /dev/null +++ b/compiler/testData/diagnostics/tests/controlStructures/redundantLabel.kt @@ -0,0 +1,39 @@ +@Target(AnnotationTarget.EXPRESSION) +@Retention(AnnotationRetention.SOURCE) +annotation class Ann + +fun testLambdaLabel() = l@ { 42 } + +fun testAnonymousFunctionLabel() = l@ fun() {} + +fun testAnnotatedLambdaLabel() = lambda@ @Ann {} + +fun testParenthesizedLambdaLabel() = lambda@ ( {} ) + +fun testLabelBoundToInvokeOperatorExpression() = l@ { 42 }() + +fun testLabelBoundToLambda() = (l@ { 42 })() + +fun testWhileLoopLabel() { + L@ while (true) {} +} + +fun testDoWhileLoopLabel() { + L@ do {} while (true) +} + +fun testForLoopLabel(xs: List) { + L@ for (x in xs) {} +} + +fun testValLabel() { + L@ val fn = {} + fn() +} + +fun testHighOrderFunctionCallLabel() { + L@ run {} +} + +fun testAnonymousObjectLabel() = + L@ object {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/controlStructures/redundantLabel.txt b/compiler/testData/diagnostics/tests/controlStructures/redundantLabel.txt new file mode 100644 index 00000000000..61993b83ece --- /dev/null +++ b/compiler/testData/diagnostics/tests/controlStructures/redundantLabel.txt @@ -0,0 +1,21 @@ +package + +public fun testAnnotatedLambdaLabel(): () -> kotlin.Unit +public fun testAnonymousFunctionLabel(): () -> kotlin.Unit +public fun testAnonymousObjectLabel(): kotlin.Any +public fun testDoWhileLoopLabel(): kotlin.Unit +public fun testForLoopLabel(/*0*/ xs: kotlin.collections.List): kotlin.Unit +public fun testHighOrderFunctionCallLabel(): kotlin.Unit +public fun testLabelBoundToInvokeOperatorExpression(): kotlin.Int +public fun testLabelBoundToLambda(): kotlin.Int +public fun testLambdaLabel(): () -> kotlin.Int +public fun testParenthesizedLambdaLabel(): () -> kotlin.Unit +public fun testValLabel(): kotlin.Unit +public fun testWhileLoopLabel(): kotlin.Unit + +@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.EXPRESSION}) @kotlin.annotation.Retention(value = AnnotationRetention.SOURCE) public final annotation class Ann : kotlin.Annotation { + public constructor Ann() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/labeledDelegatedExpression.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/labeledDelegatedExpression.kt index f8290772eae..e5b1e6b3584 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/labeledDelegatedExpression.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/labeledDelegatedExpression.kt @@ -1,7 +1,7 @@ import kotlin.reflect.KProperty class A3 { - val a: String by l@ MyProperty() + val a: String by l@ MyProperty() class MyProperty {} diff --git a/compiler/testData/diagnostics/tests/deparenthesize/ParenthesizedVariable.kt b/compiler/testData/diagnostics/tests/deparenthesize/ParenthesizedVariable.kt index fd48e57fb02..1d6225b7bc2 100644 --- a/compiler/testData/diagnostics/tests/deparenthesize/ParenthesizedVariable.kt +++ b/compiler/testData/diagnostics/tests/deparenthesize/ParenthesizedVariable.kt @@ -1,3 +1,3 @@ fun test() { - (d@ val bar = 2) + (d@ val bar = 2) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/deparenthesize/checkDeparenthesizedType.kt b/compiler/testData/diagnostics/tests/deparenthesize/checkDeparenthesizedType.kt index 8ab51d936e6..eedeedee207 100644 --- a/compiler/testData/diagnostics/tests/deparenthesize/checkDeparenthesizedType.kt +++ b/compiler/testData/diagnostics/tests/deparenthesize/checkDeparenthesizedType.kt @@ -5,19 +5,19 @@ package m fun test(i: Int?) { if (i != null) { - foo(l1@ i) + foo(l1@ i) foo((i)) - foo(l2@ (i)) - foo((l3@ i)) + foo(l2@ (i)) + foo((l3@ i)) } - val a: Int = l4@ "" + val a: Int = l4@ "" val b: Int = ("") val c: Int = checkSubtype("") val d: Int = checkSubtype("") - foo(l4@ "") + foo(l4@ "") foo(("")) foo(checkSubtype("")) foo(checkSubtype("")) diff --git a/compiler/testData/diagnostics/tests/deparenthesize/labeledSafeCall.kt b/compiler/testData/diagnostics/tests/deparenthesize/labeledSafeCall.kt index e270df0ec1d..a9e8b9255bc 100644 --- a/compiler/testData/diagnostics/tests/deparenthesize/labeledSafeCall.kt +++ b/compiler/testData/diagnostics/tests/deparenthesize/labeledSafeCall.kt @@ -1,3 +1,3 @@ fun f(s : String?) : Boolean { - return foo@(s?.equals("a"))!! + return foo@(s?.equals("a"))!! } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inference/expectedTypeFromCastParenthesized.kt b/compiler/testData/diagnostics/tests/inference/expectedTypeFromCastParenthesized.kt index 0bdaa750a1c..471612aaaf8 100644 --- a/compiler/testData/diagnostics/tests/inference/expectedTypeFromCastParenthesized.kt +++ b/compiler/testData/diagnostics/tests/inference/expectedTypeFromCastParenthesized.kt @@ -11,7 +11,7 @@ fun id(value: V) = value val par1 = (foo()) as String val par2 = ((foo())) as String -val par3 = (dd@ (foo())) as String +val par3 = (dd@ (foo())) as String val par4 = ( @bar() (foo())) as String diff --git a/compiler/testData/diagnostics/tests/inline/labeled.kt b/compiler/testData/diagnostics/tests/inline/labeled.kt index 0599469f5e1..fa36e7540bd 100644 --- a/compiler/testData/diagnostics/tests/inline/labeled.kt +++ b/compiler/testData/diagnostics/tests/inline/labeled.kt @@ -24,17 +24,17 @@ inline fun foo(bar1: (String.() -> Int) -> Int, bar2: (()->Int) -> Int) { } inline fun foo2(bar1: (String.() -> Int) -> Int) { - l1@ bar1 + l1@ bar1 - l2@ bar1 { + l2@ bar1 { 11 } - (l3@ bar1) { + (l3@ bar1) { 11 } - (l5@ (l4@ bar1)) { + (l5@ (l4@ bar1)) { 11 } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inline/parenthesized.kt b/compiler/testData/diagnostics/tests/inline/parenthesized.kt index a7423f6b5fc..046f9755a7f 100644 --- a/compiler/testData/diagnostics/tests/inline/parenthesized.kt +++ b/compiler/testData/diagnostics/tests/inline/parenthesized.kt @@ -22,6 +22,6 @@ inline fun inlineFunWithInvoke2(s: (p: Int) -> Unit) { } inline fun propagation(s: (p: Int) -> Unit) { - inlineFunWithInvoke((label@ s)) - inlineFunWithInvoke((label2@ label@ s)) + inlineFunWithInvoke((label@ s)) + inlineFunWithInvoke((label2@ label@ s)) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/TypeMismatchOnUnaryOperations.kt b/compiler/testData/diagnostics/tests/regressions/TypeMismatchOnUnaryOperations.kt index e9fcaffc8dd..93b072acbf4 100644 --- a/compiler/testData/diagnostics/tests/regressions/TypeMismatchOnUnaryOperations.kt +++ b/compiler/testData/diagnostics/tests/regressions/TypeMismatchOnUnaryOperations.kt @@ -9,8 +9,8 @@ fun main(args : Array) { val h : String = v--; val h1 : String = --v; val i : String = !true; - val j : String = foo@ true; - val k : String = foo@ bar@ true; + val j : String = foo@ true; + val k : String = foo@ bar@ true; val l : String = -1; val m : String = +1; } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/nestedCalls/argumentsInParentheses.kt b/compiler/testData/diagnostics/tests/resolve/nestedCalls/argumentsInParentheses.kt index 1ffa3472243..aab2243f1d5 100644 --- a/compiler/testData/diagnostics/tests/resolve/nestedCalls/argumentsInParentheses.kt +++ b/compiler/testData/diagnostics/tests/resolve/nestedCalls/argumentsInParentheses.kt @@ -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(label@ bar()) fooInt(a.bar()) - fooInt(((label@ if (true) (a.bar()) else bar()))) + fooInt(((label@ if (true) (a.bar()) else bar()))) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/senselessComparison/parenthesized.kt b/compiler/testData/diagnostics/tests/senselessComparison/parenthesized.kt index 1d3b5f73d77..1c8ae0da59f 100644 --- a/compiler/testData/diagnostics/tests/senselessComparison/parenthesized.kt +++ b/compiler/testData/diagnostics/tests/senselessComparison/parenthesized.kt @@ -1,23 +1,23 @@ fun testEquals(x: Int) { if (x == null) {} if (x == (null)) {} - if (x == foo@ null) {} + if (x == foo@ null) {} } fun testEqualsFlipped(x: Int) { if (null == x) {} if ((null) == x) {} - if (foo@ null == x) {} + if (foo@ null == x) {} } fun testNotEquals(x: Int) { if (x != null) {} if (x != (null)) {} - if (x != foo@ null) {} + if (x != foo@ null) {} } fun testNotEqualsFlipped(x: Int) { if (null != x) {} if ((null) != x) {} - if (foo@ null != x) {} + if (foo@ null != x) {} } \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java index a87f8812a62..0484606d77c 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java @@ -4140,6 +4140,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest { runTest("compiler/testData/diagnostics/tests/controlStructures/notAFunctionLabel_before.kt"); } + @TestMetadata("redundantLabel.kt") + public void testRedundantLabel() throws Exception { + runTest("compiler/testData/diagnostics/tests/controlStructures/redundantLabel.kt"); + } + @TestMetadata("specialConstructsAndPlatformTypes.kt") public void testSpecialConstructsAndPlatformTypes() throws Exception { runTest("compiler/testData/diagnostics/tests/controlStructures/specialConstructsAndPlatformTypes.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java index d4fff9f78be..df63df64a4d 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java @@ -4140,6 +4140,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing runTest("compiler/testData/diagnostics/tests/controlStructures/notAFunctionLabel_before.kt"); } + @TestMetadata("redundantLabel.kt") + public void testRedundantLabel() throws Exception { + runTest("compiler/testData/diagnostics/tests/controlStructures/redundantLabel.kt"); + } + @TestMetadata("specialConstructsAndPlatformTypes.kt") public void testSpecialConstructsAndPlatformTypes() throws Exception { runTest("compiler/testData/diagnostics/tests/controlStructures/specialConstructsAndPlatformTypes.kt");