Fudge
07/22/2019, 9:11 AMError in contract description: only references to parameters are allowed in contract description
Will this restriction be lifted sometime in the future?louiscad
07/22/2019, 9:13 AMFudge
07/22/2019, 9:13 AMFudge
07/22/2019, 9:18 AMclass PuzzlePiece {
val puzzleIn: Puzzle? = null
}
class Puzzle
fun PuzzlePiece.isInPuzzle(): Boolean {
contract {
returns(true) implies (this@isInPuzzle.puzzleIn != null)
}
return this.puzzleIn != null
}
Fudge
07/22/2019, 9:18 AMthis@isInPuzzle.puzzleIn
is not allowedFudge
07/22/2019, 9:20 AMif(isInPuzzle())
is more readable than
if(puzzleIn != null)
louiscad
07/22/2019, 5:29 PMlouiscad
07/22/2019, 5:30 PM