Kotlin code:
``
package controllers
native trait Todo {
fun deleteRecord() = noImpl // no return type here
fun get(key: String): Commit = noImpl
}
native trait Commit {
fun commit()
}
native(“Ember.Controller”) trait EmberController {
fun set(key: String, value: Any) = noImpl
fun get(key: String): Any = noImpl
}
class TodoController: EmberController {
var isEditing: Boolean = false
fun editTodo() {
this.set(“isEditing”, true)
}
fun removeTodo () {
var todo = this.get(“model”) as Todo
todo.deleteRecord()
todo.get(“store”).commit() // !!! can’t compiled, error: Unreachable code
}
}
I don’t know why it reports “Unreachable code”.
If I change:
``
fun deleteRecord() = noImpl
to
fun deleteRecord():Any = noImpl
It will be OK
Is it a bug ?