diff --git a/compiler/typeallowed.nim b/compiler/typeallowed.nim index a814597e27f27..5535cef4c4a0b 100644 --- a/compiler/typeallowed.nim +++ b/compiler/typeallowed.nim @@ -154,7 +154,8 @@ proc typeAllowedAux(marker: var IntSet, typ: PType, kind: TSymKind, result = typeAllowedAux(marker, t.elementType, kind, c, flags+{taIsOpenArray}) of tySink: # you cannot nest openArrays/sinks/etc. - if kind != skParam or taIsOpenArray in flags or t.elementType.kind in {tySink, tyLent, tyVar}: + # `sink openarray` is not allowed + if kind != skParam or taIsOpenArray in flags or t.elementType.kind in {tySink, tyLent, tyVar, tyOpenArray, tyVarargs}: result = t else: result = typeAllowedAux(marker, t.elementType, kind, c, flags) diff --git a/lib/pure/collections/critbits.nim b/lib/pure/collections/critbits.nim index 6435abd0d09a1..f4519b71fa582 100644 --- a/lib/pure/collections/critbits.nim +++ b/lib/pure/collections/critbits.nim @@ -523,7 +523,7 @@ func commonPrefixLen*[T](c: CritBitTree[T]): int {.inline, since((1, 3)).} = else: c.root.byte else: 0 -proc toCritBitTree*[T](pairs: sink openArray[(string, T)]): CritBitTree[T] {.since: (1, 3).} = +proc toCritBitTree*[T](pairs: openArray[(string, T)]): CritBitTree[T] {.since: (1, 3).} = ## Creates a new `CritBitTree` that contains the given `pairs`. runnableExamples: doAssert {"a": "0", "b": "1", "c": "2"}.toCritBitTree is CritBitTree[string] @@ -531,7 +531,7 @@ proc toCritBitTree*[T](pairs: sink openArray[(string, T)]): CritBitTree[T] {.sin for item in pairs: result.incl item[0], item[1] -proc toCritBitTree*(items: sink openArray[string]): CritBitTree[void] {.since: (1, 3).} = +proc toCritBitTree*(items: openArray[string]): CritBitTree[void] {.since: (1, 3).} = ## Creates a new `CritBitTree` that contains the given `items`. runnableExamples: doAssert ["a", "b", "c"].toCritBitTree is CritBitTree[void] diff --git a/tests/destructor/tmove_objconstr.nim b/tests/destructor/tmove_objconstr.nim index cdc1eb1c0d65d..fe247cb02000d 100644 --- a/tests/destructor/tmove_objconstr.nim +++ b/tests/destructor/tmove_objconstr.nim @@ -186,7 +186,7 @@ type TableNonCopyable = object x: seq[(string, MySeqNonCopyable)] -proc toTable(pairs: sink openArray[(string, MySeqNonCopyable)]): TableNonCopyable = +proc toTable(pairs: openArray[(string, MySeqNonCopyable)]): TableNonCopyable = discard diff --git a/tests/destructor/tnewruntime_misc.nim b/tests/destructor/tnewruntime_misc.nim index 21c70557dbae6..f83da019904d6 100644 --- a/tests/destructor/tnewruntime_misc.nim +++ b/tests/destructor/tnewruntime_misc.nim @@ -1,5 +1,6 @@ discard """ cmd: '''nim cpp -d:nimAllocStats --newruntime --threads:on $file''' + disabled: true output: '''(field: "value") Indeed axc