From d85b7dde7b0aabe64b51baf7e3c23506fa533f8a Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Tue, 9 Mar 2021 20:19:24 +0100 Subject: [PATCH] fixes #11225; generic sandwich problems; [backport:1.2] (#17255) * fixes #11225; generic sandwich problems; [backport:1.2] * progress * delegating these symbols must be done via 'bind' (cherry picked from commit 2f213db7eed7fb715b803559b38af4148cff02e1) --- compiler/ccgexprs.nim | 1 + compiler/cgen.nim | 3 +- compiler/closureiters.nim | 2 +- compiler/injectdestructors.nim | 3 +- compiler/jsgen.nim | 3 +- compiler/lambdalifting.nim | 5 ++- compiler/liftlocals.nim | 2 +- compiler/reorder.nim | 1 + compiler/semdata.nim | 1 + compiler/semexprs.nim | 7 +++ compiler/seminst.nim | 13 ++++++ compiler/semparallel.nim | 3 +- compiler/semstmts.nim | 4 +- compiler/semtempl.nim | 10 +++-- compiler/transf.nim | 2 +- compiler/vmgen.nim | 3 +- doc/manual.rst | 44 +++++++++++++++++++ tests/sandwich/generic_library.nim | 6 +++ tests/sandwich/helper_module.nim | 3 ++ .../sandwich/module_using_generic_library.nim | 12 +++++ tests/sandwich/tmain.nim | 9 ++++ 21 files changed, 122 insertions(+), 15 deletions(-) create mode 100644 tests/sandwich/generic_library.nim create mode 100644 tests/sandwich/helper_module.nim create mode 100644 tests/sandwich/module_using_generic_library.nim create mode 100644 tests/sandwich/tmain.nim diff --git a/compiler/ccgexprs.nim b/compiler/ccgexprs.nim index 53f60cb09b..7380aa9855 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -2744,6 +2744,7 @@ proc expr(p: BProc, n: PNode, d: var TLoc) = inc p.splitDecls genGotoState(p, n) of nkBreakState: genBreakState(p, n, d) + of nkMixinStmt, nkBindStmt: discard else: internalError(p.config, n.info, "expr(" & $n.kind & "); unknown node kind") proc genNamedConstExpr(p: BProc, n: PNode; isConst: bool): Rope = diff --git a/compiler/cgen.nim b/compiler/cgen.nim index e046d1298e..4d9b662ed9 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -838,7 +838,8 @@ proc containsResult(n: PNode): bool = for i in 0..