support UncheckedArray[T] in repr_v2.nim (#20816)

This commit is contained in:
Derek 呆
2022-11-12 02:31:59 +08:00
committed by GitHub
parent 993630e40f
commit 6007a40eac
2 changed files with 12 additions and 1 deletions

View File

@@ -189,4 +189,7 @@ proc repr*[T](x: openArray[T]): string =
##
## .. code-block:: Nim
## $(@[23, 45].toOpenArray(0, 1)) == "[23, 45]"
collectionToRepr(x, "[", ", ", "]")
collectionToRepr(x, "[", ", ", "]")
proc repr*[T](x: UncheckedArray[T]): string =
"[...]"

View File

@@ -9,6 +9,7 @@ nil
2
Obj(member: ref @["hello"])
ref (member: ref @["hello"])
ObjUa(v: 0, a: [...])
'''
"""
@@ -87,3 +88,10 @@ macro extract(): untyped =
test(parseExpr("discard"))
extract()
type
ObjUa = ref object
v: int
a: UncheckedArray[char]
echo ObjUa().repr