change non-working example to runnableExamples (#15841)

(cherry picked from commit cae92f670a)
This commit is contained in:
flywind
2020-11-05 20:11:22 +08:00
committed by narimiran
parent 5bc573cf1e
commit 5da17acfce

View File

@@ -57,13 +57,11 @@ proc createProcType(p, b: NimNode): NimNode {.compileTime.} =
macro `=>`*(p, b: untyped): untyped =
## Syntax sugar for anonymous procedures.
##
## .. code-block:: nim
##
## proc passTwoAndTwo(f: (int, int) -> int): int =
## f(2, 2)
##
## passTwoAndTwo((x, y) => x + y) # 4
runnableExamples:
proc passTwoAndTwo(f: (int, int) -> int): int =
f(2, 2)
doAssert passTwoAndTwo((x, y) => x + y) == 4
var
params = @[ident"auto"]