From dd2edf4562c49f30de1ab39f40a2f7296e90dac4 Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Fri, 12 Jul 2024 22:35:17 +0800 Subject: [PATCH] allows foreign functions having forward decls --- compiler/vmgen.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler/vmgen.nim b/compiler/vmgen.nim index 844c6ecfc3..d6bb6f3445 100644 --- a/compiler/vmgen.nim +++ b/compiler/vmgen.nim @@ -1559,7 +1559,8 @@ proc checkCanEval(c: PCtx; n: PNode) = elif s.kind == skParam and s.typ.kind == tyTypeDesc: discard else: cannotEval(c, n) elif s.kind in {skProc, skFunc, skConverter, skMethod, - skIterator} and sfWasForwarded in s.flags: + skIterator} and sfWasForwarded in s.flags and + s.originatingModule == c.module: # forbides recursive calls from the same module cannotEval(c, n) template needsAdditionalCopy(n): untyped =