ControlFlowBuilder.getExitPoint() now can return null if nothing was found #KT-10823 Fixed

Also #EA-73355 Fixed
This commit is contained in:
Mikhail Glukhikh
2016-01-27 13:43:42 +03:00
parent c5d6e8edb4
commit 26a2319d7c
7 changed files with 54 additions and 9 deletions
@@ -0,0 +1,33 @@
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
}
@@ -0,0 +1,6 @@
package
public fun find(): kotlin.Any?
public fun find2(): kotlin.Any?
public fun find3(): kotlin.Any?
public fun find4(): kotlin.Any?