Commit aef04aff0c

Andrew Kelley <andrew@ziglang.org>
2019-11-08 01:05:52
initial docs for `@as`
1 parent aa0daea
Changed files (1)
doc/langref.html.in
@@ -6445,6 +6445,14 @@ comptime {
       </p>
       {#header_close#}
 
+      {#header_open|@as#}
+      <pre>{#syntax#}@as(comptime T: type, expression) T{#endsyntax#}</pre>
+      <p>
+      Performs {#link|Type Coercion#}. This cast is allowed when the conversion is unambiguous and safe,
+      and is the preferred way to convert between types, whenever possible.
+      </p>
+      {#header_close#}
+
       {#header_open|@asyncCall#}
       <pre>{#syntax#}@asyncCall(frame_buffer: []align(@alignOf(@Frame(anyAsyncFunction))) u8, result_ptr, function_ptr, args: ...) anyframe->T{#endsyntax#}</pre>
       <p>