summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2022-11-14 22:59:37 +0800
committerGitHub <noreply@github.com>2022-11-14 15:59:37 +0100
commitd901d3b8c564f65b4f2596543b4adaf38fc57327 (patch)
tree271e1948b34b64a0e3d861b1dda4b5be66dea979 /tests
parent3eef0491a8ef904abdfe96ab97c566c794305d80 (diff)
downloadNim-d901d3b8c564f65b4f2596543b4adaf38fc57327.tar.gz
fixes #20836; fixes #20833; fixes `unsafeNew` (#20841)
* fixes #20836; fixes `unsafeNew`

* fixes #20833
Diffstat (limited to 'tests')
-rw-r--r--tests/objects/tunsafenew.nim10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/objects/tunsafenew.nim b/tests/objects/tunsafenew.nim
new file mode 100644
index 000000000..6c1b33cd9
--- /dev/null
+++ b/tests/objects/tunsafenew.nim
@@ -0,0 +1,10 @@
+discard """
+  errormsg: "conversion from int literal(-1) to Natural is invalid"
+"""
+
+type
+  Obj = object
+    case b: bool
+    else: discard
+var o: ref Obj
+unsafeNew(o, -1)
\ No newline at end of file