aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2020-03-04 18:05:14 -0500
committerAndrew Kelley <andrew@ziglang.org>2020-03-04 18:05:14 -0500
commit116e2a93f1ab068ee46f4b7cce6b3306334cdec6 (patch)
tree412c9f53fcefcb5117b89323cbf526289a4a90a0
parent3e3d46488419445c1b3a4b1da384f084c71cddb0 (diff)
downloadzig-116e2a93f1ab068ee46f4b7cce6b3306334cdec6.tar.gz
zig-116e2a93f1ab068ee46f4b7cce6b3306334cdec6.zip
update docs for `@TypeOf`
-rw-r--r--doc/langref.html.in10
1 files changed, 6 insertions, 4 deletions
diff --git a/doc/langref.html.in b/doc/langref.html.in
index 16d16718a9..50058dbd46 100644
--- a/doc/langref.html.in
+++ b/doc/langref.html.in
@@ -8371,12 +8371,14 @@ test "integer truncation" {
{#header_close#}
{#header_open|@TypeOf#}
- <pre>{#syntax#}@TypeOf(expression) type{#endsyntax#}</pre>
+ <pre>{#syntax#}@TypeOf(...) type{#endsyntax#}</pre>
<p>
- This function returns a compile-time constant, which is the type of the
- expression passed as an argument. The expression is evaluated.
+ {#syntax#}@TypeOf{#endsyntax#} is a special builtin function that takes any (nonzero) number of expressions
+ as parameters and returns the type of the result, using {#link|Peer Type Resolution#}.
+ </p>
+ <p>
+ The expressions are evaluated, however they are guaranteed to have no <em>runtime</em> side-effects:
</p>
- <p>{#syntax#}@TypeOf{#endsyntax#} guarantees no run-time side-effects within the expression:</p>
{#code_begin|test#}
const std = @import("std");
const assert = std.debug.assert;