From 2f213db7eed7fb715b803559b38af4148cff02e1 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' --- 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/nilcheck.nim | 3 +- compiler/optimizer.nim | 6 ++- compiler/reorder.nim | 1 + compiler/semdata.nim | 1 + compiler/semexprs.nim | 11 ++++- compiler/seminst.nim | 13 ++++++ compiler/semparallel.nim | 3 +- compiler/semstmts.nim | 4 +- compiler/semtempl.nim | 10 +++-- compiler/transf.nim | 2 +- compiler/varpartitions.nim | 3 +- 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 ++++ 24 files changed, 132 insertions(+), 21 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 e303971074..2a8af5c418 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -2909,6 +2909,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 f870828662..5de23649f1 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -860,7 +860,8 @@ proc containsResult(n: PNode): bool = for i in 0..