FirReturnsImpliesAnalyzer: find receiver/variable of accessor properly

This commit is contained in:
Mikhail Glukhikh
2021-03-10 13:12:11 +03:00
parent a345b81f2a
commit 798d848a91
3 changed files with 47 additions and 22 deletions
@@ -6,16 +6,16 @@ interface A {
var Any?.isNotNull: Boolean
get() {
<!WRONG_IMPLIES_CONDITION!>contract {
contract {
returns(true) implies (this@isNotNull != null)
}<!>
}
return this != null
}
set(value) {
<!WRONG_IMPLIES_CONDITION!>contract {
contract {
returns() implies (this@isNotNull != null)
require(this != null)
}<!>
}
}
fun test_1(a: A?) {