diff options
Diffstat (limited to 'tests/run/tusingstatement.nim')
-rw-r--r-- | tests/run/tusingstatement.nim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/run/tusingstatement.nim b/tests/run/tusingstatement.nim index ff81684a1..f5168dbf5 100644 --- a/tests/run/tusingstatement.nim +++ b/tests/run/tusingstatement.nim @@ -26,7 +26,8 @@ import # `opened` here could be an overloaded proc which any type can define. # A common practice can be returing an Optional[Resource] obj for which # `opened` is defined to `optional.hasValue` -macro using(e: expr): stmt = +macro using(e: expr): stmt {.immediate.} = + let e = callsite() if e.len != 2: error "Using statement: unexpected number of arguments. Got " & $e.len & ", expected: 1 or more variable assignments and a block" |