Skip to content

Commit

Permalink
fix sugar
Browse files Browse the repository at this point in the history
  • Loading branch information
disruptek committed Jan 31, 2024
1 parent be74745 commit 38d3641
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
19 changes: 19 additions & 0 deletions tests/t70_locals.nim
Original file line number Diff line number Diff line change
Expand Up @@ -501,3 +501,22 @@ suite "lifetimes":
# destroy bar.m; eg. step == 9

foo()

import std/sugar

suite "high-cal":
var r = 0
block:
## sugary procedure arguments can be used in expressions
r = 0
proc bar(x: int): int {.cps: Cont.} =
inc r
result = x * 2

proc foo(fn: (int) -> int): int {.cps: Cont.} =
inc r
result = fn: bar(2)
inc r

check 12 == foo(x => x * 3)
check r == 3
20 changes: 0 additions & 20 deletions tests/t71_sugar.nim

This file was deleted.

0 comments on commit 38d3641

Please sign in to comment.