parent
e3b5f80a89
commit
68ec7a018b
2 changed files with 3 additions and 21 deletions
|
|
@ -699,9 +699,8 @@ proc p(n: PNode; c: var Con; s: var Scope; mode: ProcessMode): PNode =
|
||||||
elif n.kind in {nkObjDownConv, nkObjUpConv}:
|
elif n.kind in {nkObjDownConv, nkObjUpConv}:
|
||||||
result = copyTree(n)
|
result = copyTree(n)
|
||||||
result[0] = p(n[0], c, s, sinkArg)
|
result[0] = p(n[0], c, s, sinkArg)
|
||||||
elif n.typ == nil or n.typ.skipTypes({tyGenericInst, tyAlias, tySink, tyVar}).kind == tyOpenArray:
|
elif n.typ == nil:
|
||||||
# 'raise X' can be part of a 'case' expression. Deal with it here.
|
# 'raise X' can be part of a 'case' expression. Deal with it here:
|
||||||
# openarrays require perfect forwarding
|
|
||||||
result = p(n, c, s, normal)
|
result = p(n, c, s, normal)
|
||||||
else:
|
else:
|
||||||
# copy objects that are not temporary but passed to a 'sink' parameter
|
# copy objects that are not temporary but passed to a 'sink' parameter
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@ discard """
|
||||||
output: '''
|
output: '''
|
||||||
hello
|
hello
|
||||||
hello
|
hello
|
||||||
@[4, 3, 2, 1]
|
|
||||||
@["a", "b"]
|
@["a", "b"]
|
||||||
'''
|
'''
|
||||||
"""
|
"""
|
||||||
|
|
@ -14,22 +13,6 @@ var val = parseMinValue()
|
||||||
if val.kind == minDictionary:
|
if val.kind == minDictionary:
|
||||||
echo val
|
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
|
# Issue #15238
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue