`Error in contract description: only references to...
# random
f
Error in contract description: only references to parameters are allowed in contract description
Will this restriction be lifted sometime in the future?
l
What's your use case?
f
Just when I closed my IDE xD
@louiscad Simplified example:
Copy code
class PuzzlePiece {
    val puzzleIn: Puzzle? = null
}

class Puzzle

fun PuzzlePiece.isInPuzzle(): Boolean {
    contract {
        returns(true) implies (this@isInPuzzle.puzzleIn != null)
    }
    return this.puzzleIn != null
}
this@isInPuzzle.puzzleIn
is not allowed
The benefit being that
if(isInPuzzle())
is more readable than
if(puzzleIn != null)
l
You can submit a feature request on kotl.in/issue
With that good example