summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorflywind <xzsflywind@gmail.com>2022-04-25 17:07:55 +0800
committerGitHub <noreply@github.com>2022-04-25 11:07:55 +0200
commitefaa6777a464b94d88cb948390397b490ccee5b8 (patch)
treeed01948ef739cec99d95ade844b138eb5ecf51a1 /compiler
parent8e6136dd59c737dab7c244e69f52864bd3fa65c9 (diff)
downloadNim-efaa6777a464b94d88cb948390397b490ccee5b8.tar.gz
fix #19435; don't create TypeBoundOps for tyOpenArray, tyVarargs [backport: 1.6] (#19723)
* fix #19435; openArray wronyly registers typebounds

* add testcase

* don't create TypeBoundOps for tyOpenArray, tyVarargs
Diffstat (limited to 'compiler')
-rw-r--r--compiler/sempass2.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/sempass2.nim b/compiler/sempass2.nim
index 9bc811a03..0ee806f36 100644
--- a/compiler/sempass2.nim
+++ b/compiler/sempass2.nim
@@ -1054,7 +1054,7 @@ proc track(tracked: PEffects, n: PNode) =
     addAsgnFact(tracked.guards, n[0], n[1])
     notNilCheck(tracked, n[1], n[0].typ)
     when false: cstringCheck(tracked, n)
-    if tracked.owner.kind != skMacro:
+    if tracked.owner.kind != skMacro and n[0].typ.kind notin {tyOpenArray, tyVarargs}:
       createTypeBoundOps(tracked, n[0].typ, n.info)
     if n[0].kind != nkSym or not isLocalVar(tracked, n[0].sym):
       checkForSink(tracked.config, tracked.c.idgen, tracked.owner, n[1])