summary refs log tree commit diff stats
path: root/tests/vm
diff options
context:
space:
mode:
authorAditya Siram <aditya.siram@gmail.com>2019-05-04 15:57:16 -0500
committerAndreas Rumpf <rumpf_a@web.de>2019-05-04 22:57:15 +0200
commitcc2be5e4c69fe655ae8546040ed1ed79fa41d055 (patch)
tree32b64218083c39e70059702fab853d7aa5ccaf96 /tests/vm
parent45759b5e904380554dc590ee87e56b61d5a17cf2 (diff)
downloadNim-cc2be5e4c69fe655ae8546040ed1ed79fa41d055.tar.gz
Fixes #11045. Assigning a proc to const and invoking. (#11076)
Diffstat (limited to 'tests/vm')
-rw-r--r--tests/vm/tconstprocassignments.nim18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/vm/tconstprocassignments.nim b/tests/vm/tconstprocassignments.nim
new file mode 100644
index 000000000..0e2d2ed16
--- /dev/null
+++ b/tests/vm/tconstprocassignments.nim
@@ -0,0 +1,18 @@
+discard """
+  output: '''
+100
+100
+'''
+"""
+
+proc f():int {.compileTime.} = 100
+
+const F = f
+echo F()
+
+const G = proc ():int =
+  let x = f
+  let y = x
+  y()
+
+echo G()