From a228e331f30def00d4369d4e792c7454963d8c4e 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 --- 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 9680fe9ba4ac..1fdfea7c411f 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -1596,11 +1596,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")