[FIR] Add processing conditional contracts on property accessors

This commit is contained in:
Dmitriy Novozhilov
2020-04-13 11:24:38 +03:00
parent 1074e4bf29
commit a01bbbb0a0
7 changed files with 54 additions and 37 deletions
@@ -20,11 +20,11 @@ var Any?.isNotNull: Boolean
fun test_1(a: A?) {
if (a.isNotNull) {
a.<!INAPPLICABLE_CANDIDATE!>foo<!>()
a.foo()
}
}
fun test_2(a: A?) {
a.isNotNull = true
a.<!INAPPLICABLE_CANDIDATE!>foo<!>()
a.foo()
}
@@ -24,12 +24,12 @@ FILE: propertyAccessors.kt
public final fun test_1(a: R|A?|): R|kotlin/Unit| {
when () {
R|<local>/a|.R|/isNotNull| -> {
R|<local>/a|.<Inapplicable(WRONG_RECEIVER): [/A.foo]>#()
R|<local>/a|.R|/A.foo|()
}
}
}
public final fun test_2(a: R|A?|): R|kotlin/Unit| {
R|<local>/a|.R|/isNotNull| = Boolean(true)
R|<local>/a|.<Inapplicable(WRONG_RECEIVER): [/A.foo]>#()
R|<local>/a|.R|/A.foo|()
}