Files
kotlin-fork/compiler/testData/diagnostics/tests/functionAsExpression/AutoLabels.fir.kt
T
Dmitriy Novozhilov 3cb17ac2f0 [FIR] Implement FirReturnAllowedChecker
Supported diagnostics:
- RETURN_NOT_ALLOWED
- RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY
2021-04-06 12:30:41 +03:00

12 lines
339 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_ANONYMOUS_PARAMETER -UNUSED_VARIABLE
fun <T, R> Iterable<T>.map(transform: (T) -> R): List<R> = null!!
fun autolabel(l: List<Int>) = l.map (fun (i: Int): Int {
return@map 4
})
fun unresolvedMapLabel(l: List<Int>) = l.map (l@ fun(i: Int): Int {
<!RETURN_NOT_ALLOWED!>return@map<!> 4
})