summary refs log tree commit diff stats
path: root/tests/proc/tproc.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/proc/tproc.nim')
-rw-r--r--tests/proc/tproc.nim31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/proc/tproc.nim b/tests/proc/tproc.nim
new file mode 100644
index 000000000..d7f861991
--- /dev/null
+++ b/tests/proc/tproc.nim
@@ -0,0 +1,31 @@
+discard """
+  output: '''
+Hello
+1
+'''
+"""
+
+
+block t8357:
+  type T = ref int
+
+  let r = new(string)
+  r[] = "Hello"
+  echo r[]
+
+
+block t8683:
+  proc foo[T](bar: proc (x, y: T): int = system.cmp, baz: int) =
+    echo "1"
+  proc foo[T](bar: proc (x, y: T): int = system.cmp) =
+    echo "2"
+
+  foo[int](baz = 5)
+
+
+block tnestprc:
+  proc Add3(x: int): int =
+    proc add(x, y: int): int {.noconv.} =
+      result = x + y
+    result = add(x, 3)
+  doAssert Add3(7) == 10