FirReturnsImpliesAnalyzer: find receiver/variable of accessor properly
This commit is contained in:
+2
-2
@@ -11,8 +11,8 @@ fun Any?.isNotNull(): Boolean {
|
||||
@OptIn(ExperimentalContracts::class)
|
||||
val Any?.isNotNull: Boolean
|
||||
get() {
|
||||
<!WRONG_IMPLIES_CONDITION!>contract {
|
||||
contract {
|
||||
returns(true) implies (this@isNotNull != null)
|
||||
}<!>
|
||||
}
|
||||
return this@isNotNull != null
|
||||
}
|
||||
+4
-4
@@ -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?) {
|
||||
|
||||
Reference in New Issue
Block a user