[FIR] KT-56877: Allow referencing implicit receivers in class contracts
This commit is contained in:
committed by
Space Team
parent
409249267c
commit
c7a71fec17
+2
-2
@@ -9,7 +9,7 @@ open class Result {
|
||||
|
||||
fun isSuccess1(): Boolean {
|
||||
contract {
|
||||
<!ERROR_IN_CONTRACT_DESCRIPTION!>returns(true) implies (this<!UNRESOLVED_LABEL!>@Result<!> is Success)<!>
|
||||
<!ERROR_IN_CONTRACT_DESCRIPTION!>returns(true) implies (this@Result is Success)<!>
|
||||
}
|
||||
return this@Result is Success
|
||||
}
|
||||
@@ -18,7 +18,7 @@ open class Result {
|
||||
contract {
|
||||
// implicit type ref
|
||||
// ERROR CLASS: Cannot calculate return type during full-body resolution (local class/object?)
|
||||
<!ERROR_IN_CONTRACT_DESCRIPTION!>returns(true) implies (this<!UNRESOLVED_LABEL!>@Result<!>.someProperty == 10)<!>
|
||||
<!ERROR_IN_CONTRACT_DESCRIPTION!>returns(true) implies (this@Result.someProperty == 10)<!>
|
||||
}
|
||||
return this@Result.someProperty == 10
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user