diff options
-rw-r--r-- | compiler/injectdestructors.nim | 5 | ||||
-rw-r--r-- | tests/arc/t14383.nim | 19 |
2 files changed, 3 insertions, 21 deletions
diff --git a/compiler/injectdestructors.nim b/compiler/injectdestructors.nim index 9d1f43595..28f2c93f1 100644 --- a/compiler/injectdestructors.nim +++ b/compiler/injectdestructors.nim @@ -699,9 +699,8 @@ proc p(n: PNode; c: var Con; s: var Scope; mode: ProcessMode): PNode = elif n.kind in {nkObjDownConv, nkObjUpConv}: result = copyTree(n) result[0] = p(n[0], c, s, sinkArg) - elif n.typ == nil or n.typ.skipTypes({tyGenericInst, tyAlias, tySink, tyVar}).kind == tyOpenArray: - # 'raise X' can be part of a 'case' expression. Deal with it here. - # openarrays require perfect forwarding + elif n.typ == nil: + # 'raise X' can be part of a 'case' expression. Deal with it here: result = p(n, c, s, normal) else: # copy objects that are not temporary but passed to a 'sink' parameter diff --git a/tests/arc/t14383.nim b/tests/arc/t14383.nim index 78afc58e2..f112a1a6c 100644 --- a/tests/arc/t14383.nim +++ b/tests/arc/t14383.nim @@ -3,7 +3,6 @@ discard """ output: ''' hello hello -@[4, 3, 2, 1] @["a", "b"] ''' """ @@ -14,22 +13,6 @@ var val = parseMinValue() if val.kind == minDictionary: echo val - -#------------------------------------------------------------------------------ -# Issue #15035 -#------------------------------------------------------------------------------ - -proc countRun(lst: sink openArray[int]): int = - discard - -proc timSort(lst: var openArray[int]) = - let run = countRun(lst) - -var a = @[4, 3, 2, 1] -timSort(a) -echo a - - #------------------------------------------------------------------------------ # Issue #15238 #------------------------------------------------------------------------------ @@ -50,4 +33,4 @@ echo x #------------------------------------------------------------------------------ import std/os -discard getFileInfo(".") \ No newline at end of file +discard getFileInfo(".") |