From e70379811b2b2b2d3d8e4fad1c7573ea30074054 Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Sun, 6 Nov 2022 22:25:55 +0800 Subject: [PATCH] fixes regression #17121; adding doc comment in importc proc makes it silently noop at CT (#20766) * fixes regression #17121; adding doc comment in importc proc makes it silently noop at CT * Update compiler/vmgen.nim Co-authored-by: Andreas Rumpf (cherry picked from commit a228e331f30def00d4369d4e792c7454963d8c4e) --- compiler/vmgen.nim | 11 ++++++++++- tests/vm/t17121.nim | 9 +++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 tests/vm/t17121.nim diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index 4cfaa86b06..af99d45e21 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -1630,11 +1630,20 @@ proc genTypeLit(c: PCtx; t: PType; dest: var TDest) = n.typ = t genLit(c, n, dest) +proc isEmptyBody(n: PNode): bool = + case n.kind + of nkStmtList: + for i in 0..", varargs, discardable.} = + ## foo bar + runnableExamples: discard +static: + let a = c_printf("abc\n")