summary refs log tree commit diff stats
path: root/tests/dll/nimhcr_0_3.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/dll/nimhcr_0_3.nim')
-rw-r--r--tests/dll/nimhcr_0_3.nim19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/dll/nimhcr_0_3.nim b/tests/dll/nimhcr_0_3.nim
new file mode 100644
index 000000000..183424e11
--- /dev/null
+++ b/tests/dll/nimhcr_0_3.nim
@@ -0,0 +1,19 @@
+
+import hotcodereloading
+
+import nimhcr_1
+import nimhcr_2 # a new and different import!
+
+proc makeCounter*(): auto =
+  return iterator: int {.closure.} =
+    for i in countup(0, 10, 1):
+      yield i
+
+let c = makeCounter()
+
+afterCodeReload:
+  echo "   0: after - closure iterator: ", c()
+  echo "   0: after - closure iterator: ", c()
+  echo "   0: after - c_2 = ", c_2
+
+proc getInt*(): int = return g_1 + g_2.len