summary refs log tree commit diff stats
path: root/tests/run
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-09-22 22:43:36 +0200
committerAraq <rumpf_a@web.de>2012-09-22 22:43:36 +0200
commit759b3201ad7f60ee865f9c0cec57d6ce63c74b73 (patch)
tree234e76619824ce081d9b1eaf469242d36de1936e /tests/run
parent3ef146b0eacb8781dd0e352925001de342d6cc9d (diff)
downloadNim-759b3201ad7f60ee865f9c0cec57d6ce63c74b73.tar.gz
proc bodies can be expressions with a type
Diffstat (limited to 'tests/run')
-rwxr-xr-xtests/run/tenumhole.nim5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/run/tenumhole.nim b/tests/run/tenumhole.nim
index b721c73dd..a35526378 100755
--- a/tests/run/tenumhole.nim
+++ b/tests/run/tenumhole.nim
@@ -13,8 +13,11 @@ type
     valueC,
     valueD = (4, "abc")
  
+# test the new "proc body can be an expr" feature:
+proc getValue: TMyEnum = valueD
+ 
 # trick the optimizer with a variable:
-var x = valueD
+var x = getValue()
 echo valueA, ord(valueA), valueB, ord(valueB), valueC, valueD, ord(valueD), x