diff options
author | Araq <rumpf_a@web.de> | 2012-09-22 22:43:36 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2012-09-22 22:43:36 +0200 |
commit | 759b3201ad7f60ee865f9c0cec57d6ce63c74b73 (patch) | |
tree | 234e76619824ce081d9b1eaf469242d36de1936e /tests/run | |
parent | 3ef146b0eacb8781dd0e352925001de342d6cc9d (diff) | |
download | Nim-759b3201ad7f60ee865f9c0cec57d6ce63c74b73.tar.gz |
proc bodies can be expressions with a type
Diffstat (limited to 'tests/run')
-rwxr-xr-x | tests/run/tenumhole.nim | 5 |
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 |