From a5b47bc2c2de54ea853ac48e745c75c499d5c9bb Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Fri, 5 Apr 2019 12:37:49 -0400 Subject: [PATCH] docs: update `@typeInfo` definition and clarify field order --- doc/langref.html.in | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/doc/langref.html.in b/doc/langref.html.in index 7e2f43a173..bb2a67c562 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -7448,6 +7448,8 @@ pub const TypeInfo = union(TypeId) { ArgTuple: void, Opaque: void, Promise: Promise, + Vector: Vector, + EnumLiteral: void, pub const Int = struct { @@ -7465,11 +7467,13 @@ pub const TypeInfo = union(TypeId) { is_volatile: bool, alignment: comptime_int, child: type, + is_allowzero: bool, pub const Size = enum { One, Many, Slice, + C, }; }; @@ -7510,9 +7514,7 @@ pub const TypeInfo = union(TypeId) { value: comptime_int, }; - pub const ErrorSet = struct { - errors: []Error, - }; + pub const ErrorSet = ?[]Error; pub const EnumField = struct { name: []const u8, @@ -7567,6 +7569,11 @@ pub const TypeInfo = union(TypeId) { child: ?type, }; + pub const Vector = struct { + len: comptime_int, + child: type, + }; + pub const Definition = struct { name: []const u8, is_pub: bool, @@ -7598,6 +7605,11 @@ pub const TypeInfo = union(TypeId) { }; }; {#code_end#} +

+ For {#link|structs|struct#}, {#link|unions|union#}, {#link|enums|enum#}, and + {#link|error sets|Error Set Type#}, the fields are guaranteed to be in the same + order as declared. For declarations, the order is unspecified. +

{#header_close#} {#header_open|@typeName#}