Skip to content

Commit 848a1cd

Browse files
authored
Merge pull request #7061 from Master-Killer/7059-docfix-post-conditions
Make Post Conditions example compile in implicit-function-types.md
2 parents ff43160 + b270218 commit 848a1cd

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)