Type parameter as result type: more precise expected type definition #KT-5385 Fixed

Tests for KT-5385 KT-10223 KT-7800 KT-7817 + something related
This commit is contained in:
Mikhail Glukhikh
2015-11-27 18:59:02 +03:00
parent 51abb021bc
commit 5729855e4f
24 changed files with 352 additions and 13 deletions
@@ -0,0 +1,12 @@
class Foo(val s: String)
fun foo(): Foo? = Foo("OK")
fun <T> run(f: () -> T): T = f()
val foo: Foo = run {
val x = foo()
if (x == null) throw Exception()
x
}
fun box() = foo.s