From b2702181cf3bb17f958fff2e1a5b6355669fa3c5 Mon Sep 17 00:00:00 2001 From: Master-Killer Date: Sun, 18 Aug 2019 00:11:26 +0200 Subject: [PATCH] Update implicit-function-types.md Make Post Conditions example compile --- docs/docs/reference/contextual/implicit-function-types.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/docs/reference/contextual/implicit-function-types.md b/docs/docs/reference/contextual/implicit-function-types.md index d1ad28a1b46e..b863871331e5 100644 --- a/docs/docs/reference/contextual/implicit-function-types.md +++ b/docs/docs/reference/contextual/implicit-function-types.md @@ -120,9 +120,10 @@ object PostConditions { def result[T] given (r: WrappedResult[T]): T = r - def (x: T) - ensuring[T](condition: given WrappedResult[T] => Boolean): T = - assert(condition) given x + def (x: T) ensuring[T](condition: given WrappedResult[T] => Boolean): T = { + assert(condition given x) + x + } } import PostConditions.{ensuring, result}