Files
kotlin-fork/compiler/testData/diagnostics/tests/controlStructures/redundantLabel.fir.kt
T

39 lines
779 B
Kotlin
Vendored

@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@ <!UNRESOLVED_REFERENCE!>{ 42 }()<!>
fun testLabelBoundToLambda() = <!UNRESOLVED_REFERENCE!>(l@ { 42 })()<!>
fun testWhileLoopLabel() {
L@ while (true) {}
}
fun testDoWhileLoopLabel() {
L@ do {} while (true)
}
fun testForLoopLabel(xs: List<Any>) {
L@ for (x in xs) {}
}
fun testValLabel() {
L@ val fn = {}
fn()
}
fun testHighOrderFunctionCallLabel() {
L@ run {}
}
fun testAnonymousObjectLabel() =
L@ object {}