* fixes #21439; Add tyOpenArray to genTypeInfo. * Add test.
This commit is contained in:
parent
425225119a
commit
4ae598762e
2 changed files with 15 additions and 1 deletions
|
|
@ -133,7 +133,7 @@ proc genTypeInfo(p: PProc, typ: PType): Rope =
|
||||||
"var $1 = {size: 0,kind: $2,base: null,node: null,finalizer: null};$n" %
|
"var $1 = {size: 0,kind: $2,base: null,node: null,finalizer: null};$n" %
|
||||||
[result, rope(ord(t.kind))]
|
[result, rope(ord(t.kind))]
|
||||||
prepend(p.g.typeInfo, s)
|
prepend(p.g.typeInfo, s)
|
||||||
of tyVar, tyLent, tyRef, tyPtr, tySequence, tyRange, tySet:
|
of tyVar, tyLent, tyRef, tyPtr, tySequence, tyRange, tySet, tyOpenArray:
|
||||||
var s =
|
var s =
|
||||||
"var $1 = {size: 0, kind: $2, base: null, node: null, finalizer: null};$n" %
|
"var $1 = {size: 0, kind: $2, base: null, node: null, finalizer: null};$n" %
|
||||||
[result, rope(ord(t.kind))]
|
[result, rope(ord(t.kind))]
|
||||||
|
|
|
||||||
14
tests/js/t21439.nim
Normal file
14
tests/js/t21439.nim
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
discard """
|
||||||
|
action: "compile"
|
||||||
|
"""
|
||||||
|
|
||||||
|
proc test(a: openArray[string]): proc =
|
||||||
|
result = proc =
|
||||||
|
for i in a:
|
||||||
|
discard i
|
||||||
|
|
||||||
|
|
||||||
|
const a = ["t1", "t2"]
|
||||||
|
|
||||||
|
discard test(a)
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue