J2K: Get nullability from variable initializer when converting call

#KT-11534 In Progress
This commit is contained in:
Natalia Ukhorskaya
2016-03-25 19:49:49 +03:00
parent f3a3c0886f
commit 98c3b39f7e
16 changed files with 257 additions and 9 deletions
+2 -4
View File
@@ -1,5 +1,3 @@
// ERROR: Type mismatch: inferred type is Passenger.PassChild? but Passenger.PassChild was expected
// ERROR: Type mismatch: inferred type is Passenger.PassChild? but Passenger.PassChild was expected
class Passenger {
open class PassParent
@@ -18,9 +16,9 @@ class Passenger {
val pass = provideNullable(1)
if (1 == 2) {
assert(pass != null)
accept2(pass as PassChild?)
accept2((pass as PassChild?)!!)
}
accept2(pass as PassChild?)
accept2((pass as PassChild?)!!)
}
fun accept1(p: PassChild) {