diff options
author | Zach Smith <subsetpark@gmail.com> | 2017-12-28 14:10:27 -0500 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-12-30 10:50:33 +0100 |
commit | 3714e2f8714e0a1bc1efbafa26696b708fe9a4b5 (patch) | |
tree | 9302e54ca2e264387105c296f612a0ea4056cc04 /doc/manual/stmts.txt | |
parent | 26a34d52a089f54ec6b073230742ed9894d8d197 (diff) | |
download | Nim-3714e2f8714e0a1bc1efbafa26696b708fe9a4b5.tar.gz |
Add compile-time paragraph to manual
Includes a note in the manual entry for case statements clarifying that the branch values must be known at compile time.
Diffstat (limited to 'doc/manual/stmts.txt')
-rw-r--r-- | doc/manual/stmts.txt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/doc/manual/stmts.txt b/doc/manual/stmts.txt index b24ec3b4a..721b5cff8 100644 --- a/doc/manual/stmts.txt +++ b/doc/manual/stmts.txt @@ -296,6 +296,10 @@ empty ``discard`` statement should be used. For non ordinal types it is not possible to list every possible value and so these always require an ``else`` part. +As case statements perform compile-time exhaustiveness checks, the value in +every ``of`` branch must be known at compile time. This fact is also exploited +to generate more performant code. + As a special semantic extension, an expression in an ``of`` branch of a case statement may evaluate to a set or array constructor; the set or array is then expanded into a list of its elements: |