[FIR-TEST] Add new testdata generated after changes in previous commit
This commit is contained in:
+41
@@ -0,0 +1,41 @@
|
||||
package a
|
||||
|
||||
interface A {
|
||||
val b: B
|
||||
val nb: B?
|
||||
}
|
||||
|
||||
interface B {
|
||||
fun foo(): Int
|
||||
}
|
||||
|
||||
fun test(u: A?, x: A?, y: A?, z: A?, w: A, v: A?) {
|
||||
u?.b?.foo()!! // was UNNECESSARY_SAFE_CALL everywhere, because result type (of 'foo()') wasn't made nullable
|
||||
u!!.b?.foo()!!
|
||||
x?.b!!.foo()!!
|
||||
// x?.b is not null
|
||||
x!!.b!!.foo()!!
|
||||
|
||||
y?.nb?.foo()!!
|
||||
y!!.nb?.foo()!!
|
||||
z?.nb!!.foo()!!
|
||||
// z?.nb is not null
|
||||
z!!.nb!!.foo()!!
|
||||
|
||||
w.b?.foo()!!
|
||||
w.b!!.foo()!!
|
||||
w.nb?.foo()!!
|
||||
w.nb!!.foo()!!
|
||||
|
||||
v!!.b.foo()!!
|
||||
}
|
||||
|
||||
fun B?.bar(): Int = 1
|
||||
fun B?.baz(): Int? = 1
|
||||
|
||||
fun doInt(i: Int) = i
|
||||
|
||||
fun test(a: A?) {
|
||||
doInt(a?.b.bar()!!)
|
||||
doInt(a?.b.baz()!!)
|
||||
}
|
||||
Reference in New Issue
Block a user