From d5570085c4adf91fe6083bd83d99e63920634ef6 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/optimizer.nim | 6 ++- 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/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 ++++ 23 files changed, 128 insertions(+), 18 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 0f034c4a58059..9d39171659a60 100644 --- a/compiler/ccgexprs.nim +++ b/compiler/ccgexprs.nim @@ -2852,6 +2852,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 6bc6ca2d704fa..20bf25d934dac 100644 --- a/compiler/cgen.nim +++ b/compiler/cgen.nim @@ -855,7 +855,8 @@ proc containsResult(n: PNode): bool = for i in 0..