fixes #7878
This commit is contained in:
parent
825e08b046
commit
d69a7842fa
2 changed files with 11 additions and 2 deletions
|
|
@ -1501,7 +1501,7 @@ proc genRepr(p: BProc, e: PNode, d: var TLoc) =
|
||||||
addrLoc(p.config, a), genTypeInfo(p.module, t, e.info)]), a.storage)
|
addrLoc(p.config, a), genTypeInfo(p.module, t, e.info)]), a.storage)
|
||||||
of tyOpenArray, tyVarargs:
|
of tyOpenArray, tyVarargs:
|
||||||
var b: TLoc
|
var b: TLoc
|
||||||
case a.t.kind
|
case skipTypes(a.t, abstractVarRange).kind
|
||||||
of tyOpenArray, tyVarargs:
|
of tyOpenArray, tyVarargs:
|
||||||
putIntoDest(p, b, e, "$1, $1Len_0" % [rdLoc(a)], a.storage)
|
putIntoDest(p, b, e, "$1, $1Len_0" % [rdLoc(a)], a.storage)
|
||||||
of tyString, tySequence:
|
of tyString, tySequence:
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
discard """
|
discard """
|
||||||
output: "{a, b}{'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'}"
|
output: '''{a, b}{'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'}
|
||||||
|
[1, 2, 3, 4, 5, 6]'''
|
||||||
"""
|
"""
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
@ -25,3 +26,11 @@ when false:
|
||||||
# "a", "b", "c", "d", "e"
|
# "a", "b", "c", "d", "e"
|
||||||
#]
|
#]
|
||||||
#echo(repr(testseq))
|
#echo(repr(testseq))
|
||||||
|
|
||||||
|
# bug #7878
|
||||||
|
proc test(variable: var openarray[int]) =
|
||||||
|
echo repr(variable)
|
||||||
|
|
||||||
|
var arr = [1, 2, 3, 4, 5, 6]
|
||||||
|
|
||||||
|
test(arr)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue