Files
kotlin/compiler/testData/diagnostics/tests/functionLiterals/LabeledFunctionLiterals.kt
Svetlana Isakova fd5a2056c1 analyze labeled function literals as usual ones
(specially as function literals, not as other expressions)
2013-09-03 13:09:10 +04:00

16 lines
349 B
Kotlin

package h
//traits to make ambiguity with function literal as an argument
trait A
trait B
trait C: A, B
fun foo<T>(<!UNUSED_PARAMETER!>a<!>: A, f: () -> T): T = f()
fun foo<T>(<!UNUSED_PARAMETER!>b<!>: B, f: () -> T): T = f()
fun test(c: C) {
<!CANNOT_COMPLETE_RESOLVE!>foo<!>(c) @f {
c<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
}
}