Skip to content

Commit b270218

Browse files
Update implicit-function-types.md
Make Post Conditions example compile
1 parent ff43160 commit b270218

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

docs/docs/reference/contextual/implicit-function-types.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,10 @@ object PostConditions {
120120

121121
def result[T] given (r: WrappedResult[T]): T = r
122122

123-
def (x: T)
124-
ensuring[T](condition: given WrappedResult[T] => Boolean): T =
125-
assert(condition) given x
123+
def (x: T) ensuring[T](condition: given WrappedResult[T] => Boolean): T = {
124+
assert(condition given x)
125+
x
126+
}
126127
}
127128
import PostConditions.{ensuring, result}
128129

0 commit comments

Comments
 (0)