diff --git a/doc/langref.html.in b/doc/langref.html.in index bd3fb41340..986da22dd2 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -2785,6 +2785,16 @@ test "implicitly cast to const pointer" { use the C calling convention may pass structs and unions by value.
{#header_close#} + {#header_open|Function Reflection#} + {#code_begin|test#} +const assert = @import("std").debug.assert; + +test "fn reflection" { + assert(@typeOf(assert).ReturnType == void); + assert(@typeOf(assert).is_var_args == false); +} + {#code_end#} + {#header_close#} {#header_close#} {#header_open|Errors#}@@ -2998,6 +3008,31 @@ fn createFoo(param: i32) %Foo { {#see_also|defer|if|switch#} + {#header_open|Error Union Type#} +
An error union is created by putting a % in front of a type.
+ You can use compile-time reflection to access the child type of an error union:
TODO
+ {#header_close#} {#header_close#} {#header_open|Nullables#}@@ -3099,6 +3134,24 @@ fn doAThing(nullable_foo: ?&Foo) void { The optimizer can sometimes make better decisions knowing that pointer arguments cannot be null.
+ {#header_open|Nullable Type#} +A nullable is created by putting ? in front of a type. You can use compile-time
+ reflection to access the child type of a nullable:
TODO: explain implicit vs explicit casting
@@ -5731,9 +5784,6 @@ ContainerDecl = option("extern" | "packed")TODO: document changes from a31b23c46ba2a8c28df01adc1aa0b4d878b9a5cf (compile time reflection additions)
- {#header_close#}