mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-07 20:34:21 +00:00
support UncheckedArray[T] in repr_v2.nim (#20816)
This commit is contained in:
@@ -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 =
|
||||
"[...]"
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user