summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/sempass2.nim1
-rw-r--r--tests/arc/t14383.nim18
2 files changed, 18 insertions, 1 deletions
diff --git a/compiler/sempass2.nim b/compiler/sempass2.nim
index 41d83ed55..dc833ce34 100644
--- a/compiler/sempass2.nim
+++ b/compiler/sempass2.nim
@@ -826,6 +826,7 @@ proc trackCall(tracked: PEffects; n: PNode) =
     for i in 1..<min(n.safeLen, op.len):
       case op[i].kind
       of tySink:
+        createTypeBoundOps(tracked,  op[i][0], n.info)
         checkForSink(tracked.config, tracked.owner, n[i])
       of tyVar:
         tracked.hasDangerousAssign = true
diff --git a/tests/arc/t14383.nim b/tests/arc/t14383.nim
index 742088937..412e11326 100644
--- a/tests/arc/t14383.nim
+++ b/tests/arc/t14383.nim
@@ -4,6 +4,7 @@ discard """
 hello
 hello
 @[4, 3, 2, 1]
+@["a", "b"]
 '''
 """
 
@@ -26,4 +27,19 @@ proc timSort(lst: var openArray[int]) =
 
 var a = @[4, 3, 2, 1]
 timSort(a)
-echo a
\ No newline at end of file
+echo a
+
+
+#------------------------------------------------------------------------------
+# Issue #15238
+#------------------------------------------------------------------------------
+
+proc sinkArg(x: sink seq[string]) =
+  discard
+
+proc varArg(lst: var seq[string]) = 
+  sinkArg(lst)
+
+var x = @["a", "b"]
+varArg(x)
+echo x