mirror of
https://github.com/nim-lang/Nim.git
synced 2026-01-04 20:17:42 +00:00
* fixes #21439; Add tyOpenArray to genTypeInfo. * Add test.
This commit is contained in:
committed by
GitHub
parent
425225119a
commit
4ae598762e
@@ -133,7 +133,7 @@ proc genTypeInfo(p: PProc, typ: PType): Rope =
|
||||
"var $1 = {size: 0,kind: $2,base: null,node: null,finalizer: null};$n" %
|
||||
[result, rope(ord(t.kind))]
|
||||
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 $1 = {size: 0, kind: $2, base: null, node: null, finalizer: null};$n" %
|
||||
[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)
|
||||
|
||||
Reference in New Issue
Block a user