summary refs log tree commit diff stats
path: root/tests/arc/trepr.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/arc/trepr.nim')
-rw-r--r--tests/arc/trepr.nim33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/arc/trepr.nim b/tests/arc/trepr.nim
index a870b40b7..abf28330a 100644
--- a/tests/arc/trepr.nim
+++ b/tests/arc/trepr.nim
@@ -9,8 +9,12 @@ nil
 2
 Obj(member: ref @["hello"])
 ref (member: ref @["hello"])
+ObjUa(v: 0, a: [...])
 '''
 """
+
+# xxx consider merging with `tests/stdlib/trepr.nim` to increase overall test coverage
+
 import tables
 
 type
@@ -62,3 +66,32 @@ var c2 = new tuple[member: ref seq[string]]
 c2.member = new seq[string]
 c2.member[] = @["hello"]
 echo c2.repr
+
+proc p2 =
+  echo "hey"
+
+discard repr p2
+
+
+#####################################################################
+# bug #15043
+
+import macros
+
+macro extract(): untyped =
+  result = newStmtList()
+  var x: seq[tuple[node: NimNode]]
+
+  proc test(n: NimNode) {.closure.} =
+    x.add (node: n)
+  
+  test(parseExpr("discard"))
+  
+extract()
+
+type
+  ObjUa = ref object
+    v: int
+    a: UncheckedArray[char]
+
+echo ObjUa().repr