summary refs log tree commit diff stats
path: root/tests/system/trefs.nim
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-02-01 14:58:12 +0800
committerGitHub <noreply@github.com>2023-02-01 07:58:12 +0100
commitcbf3ed9d92b32e9e28f1e4d52300d9b103ee6fa1 (patch)
treeb20a6f8f00dbcb069b7cde764e5ae7fc633f3e05 /tests/system/trefs.nim
parentb5f64f55d02a8ba980244596dcf310dd76b48fd8 (diff)
downloadNim-cbf3ed9d92b32e9e28f1e4d52300d9b103ee6fa1.tar.gz
fixes #21317; 1.6.4 regression; etyBaseIndex should return fat pointers [backport 1.6] (#21320)
fixes #21317; regression; etyBaseIndex should return fat pointers
Diffstat (limited to 'tests/system/trefs.nim')
-rw-r--r--tests/system/trefs.nim15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/system/trefs.nim b/tests/system/trefs.nim
new file mode 100644
index 000000000..8c36aec52
--- /dev/null
+++ b/tests/system/trefs.nim
@@ -0,0 +1,15 @@
+discard """
+  targets: "c js"
+"""
+
+# bug #21317
+proc parseHook*(v: var ref int) =
+  var a: ref int
+  new(a)
+  a[] = 123
+  v = a
+
+proc fromJson2*(): ref int =
+  parseHook(result)
+
+doAssert fromJson2()[] == 123