mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-25 12:25:08 +00:00
fixes #7878
This commit is contained in:
@@ -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)
|
||||
of tyOpenArray, tyVarargs:
|
||||
var b: TLoc
|
||||
case a.t.kind
|
||||
case skipTypes(a.t, abstractVarRange).kind
|
||||
of tyOpenArray, tyVarargs:
|
||||
putIntoDest(p, b, e, "$1, $1Len_0" % [rdLoc(a)], a.storage)
|
||||
of tyString, tySequence:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
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
|
||||
@@ -25,3 +26,11 @@ when false:
|
||||
# "a", "b", "c", "d", "e"
|
||||
#]
|
||||
#echo(repr(testseq))
|
||||
|
||||
# bug #7878
|
||||
proc test(variable: var openarray[int]) =
|
||||
echo repr(variable)
|
||||
|
||||
var arr = [1, 2, 3, 4, 5, 6]
|
||||
|
||||
test(arr)
|
||||
|
||||
Reference in New Issue
Block a user