From 116e2a93f1ab068ee46f4b7cce6b3306334cdec6 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 4 Mar 2020 18:05:14 -0500 Subject: [PATCH] update docs for `@TypeOf` --- doc/langref.html.in | 10 ++++++---- 1 file 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#} -
{#syntax#}@TypeOf(expression) type{#endsyntax#}
+
{#syntax#}@TypeOf(...) type{#endsyntax#}

- 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#}. +

+

+ The expressions are evaluated, however they are guaranteed to have no runtime side-effects:

-

{#syntax#}@TypeOf{#endsyntax#} guarantees no run-time side-effects within the expression:

{#code_begin|test#} const std = @import("std"); const assert = std.debug.assert;