Files
kotlin-fork/compiler/testData/diagnostics/tests/controlFlowAnalysis/kt10823.kt
T
Dmitry Petrov 2b27e64fc8 Improve diagnostics for "not yet supported in inline"
- Tell user what exactly is not supported (e.g., local inline function)
- Reduce diagnostics range to a keyword or an identifier
  where appropriate

 #KT-16223 Fixed Target versions 1.1.50
2017-09-06 09:46:33 +03:00

34 lines
751 B
Kotlin
Vendored

fun find2(): Any? {
fun visit(element: Any) {
<!RETURN_NOT_ALLOWED!>return@find2<!> element
}
return null
}
// For find(): AssertionError at ControlFlowInstructionsGeneratorWorker.getExitPoint()
fun find(): Any? {
object : Any() {
fun visit(element: Any) {
<!RETURN_NOT_ALLOWED!>return@find<!> element
}
}
return null
}
fun find4(): Any? {
<!NOT_YET_SUPPORTED_IN_INLINE!>inline<!> fun visit(element: Any) {
<!RETURN_NOT_ALLOWED!>return@find4<!> element
}
return null
}
fun find3(): Any? {
object : Any() {
<!NOTHING_TO_INLINE!>inline<!> fun visit(element: Any) {
<!RETURN_NOT_ALLOWED!>return@find3<!> element
}
}
return null
}