vgrechka
12/22/2016, 12:21 PMqwe_doesntCompile()
below was OK, in M04 it's not. Which milestone is more buggy? Without explicit `return`s M04 is happy.
private sealed class A {
class A1 : A()
class A2 : A()
}
fun qwe_doesntCompile() {
val a: Promise<A.A2?> = async { // Error: ...inferred type is Promise<A?> but Promise<A.A2?> was expected
val b: A = A.A2()
when (b) {
is A.A2 -> return@async b
else -> return@async null
}
}
}
fun qwe_compilesOK() {
val a: Promise<A.A2?> = async {
val b: A = A.A2()
when (b) {
is A.A2 -> b
else -> null
}
}
}