Files
kotlin-fork/compiler/testData/diagnostics/tests/resolve/nestedCalls/argumentsInParentheses.kt
T
Dmitry Petrov df6d4f358a 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.
2018-07-25 12:08:20 +03:00

20 lines
435 B
Kotlin
Vendored

interface Foo<T>
class Bar {
operator fun <T> invoke(): Foo<T> = throw Exception()
}
class A {
val bar = Bar()
}
fun fooInt(l: Foo<Int>) = l
fun test(bar: Bar, a: A) {
// no elements with error types
fooInt((bar()))
fooInt(if (true) bar() else bar())
fooInt(<!REDUNDANT_LABEL_WARNING!>label@<!> bar())
fooInt(a.bar())
fooInt(((<!REDUNDANT_LABEL_WARNING!>label@<!> if (true) (a.bar()) else bar())))
}