summary refs log tree commit diff stats
path: root/tests/cpp
diff options
context:
space:
mode:
authorJuan M Gómez <info@jmgomez.me>2024-03-21 07:48:14 +0000
committerGitHub <noreply@github.com>2024-03-21 08:48:14 +0100
commit33902d9dbb65fbfdfbd6e3b2a34c6e19eccb762f (patch)
tree933b843969ccaa492030f16e0b3389dd0ac3e303 /tests/cpp
parent50c1e93a7481a79634b5d444806c94c1ea12b8ff (diff)
downloadNim-33902d9dbb65fbfdfbd6e3b2a34c6e19eccb762f.tar.gz
[Cpp] Fixes an issue when mixing hooks and calls (#23428)
Diffstat (limited to 'tests/cpp')
-rw-r--r--tests/cpp/tconstructor.nim15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/cpp/tconstructor.nim b/tests/cpp/tconstructor.nim
index ac73b78e6..922ee54fd 100644
--- a/tests/cpp/tconstructor.nim
+++ b/tests/cpp/tconstructor.nim
@@ -115,4 +115,17 @@ type Foo {.exportc.} = object
 
 proc makeFoo(): Foo {.used, constructor, nodecl.} = discard
 
-echo $Foo()
\ No newline at end of file
+echo $Foo()
+
+type Boo = object
+proc `=copy`(dest: var Boo; src: Boo) = discard
+
+proc makeBoo(): Boo {.constructor.} = Boo()
+proc makeBoo2(): Boo  = Boo()
+
+block:
+  proc main =
+    var b = makeBoo()
+    var b2 = makeBoo2()
+
+  main()
\ No newline at end of file