authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-04-05 12:37:49-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-04-05 12:38:15-04:00
loga5b47bc2c2de54ea853ac48e745c75c499d5c9bb
tree34bdf7ce11b989329c4e6594b9c80506577f0a6a
parent2f236e6efb2c95d086b916334db492b948b48e44
signaturelock-open Commit is signed but in an unrecognized format.

docs: update `@typeInfo` definition and clarify field order


1 files changed, 15 insertions(+), 3 deletions(-)

doc/langref.html.in+15-3
......@@ -7448,6 +7448,8 @@ pub const TypeInfo = union(TypeId) {
74487448 ArgTuple: void,
74497449 Opaque: void,
74507450 Promise: Promise,
7451 Vector: Vector,
7452 EnumLiteral: void,
74517453
74527454
74537455 pub const Int = struct {
......@@ -7465,11 +7467,13 @@ pub const TypeInfo = union(TypeId) {
74657467 is_volatile: bool,
74667468 alignment: comptime_int,
74677469 child: type,
7470 is_allowzero: bool,
74687471
74697472 pub const Size = enum {
74707473 One,
74717474 Many,
74727475 Slice,
7476 C,
74737477 };
74747478 };
74757479
......@@ -7510,9 +7514,7 @@ pub const TypeInfo = union(TypeId) {
75107514 value: comptime_int,
75117515 };
75127516
7513 pub const ErrorSet = struct {
7514 errors: []Error,
7515 };
7517 pub const ErrorSet = ?[]Error;
75167518
75177519 pub const EnumField = struct {
75187520 name: []const u8,
......@@ -7567,6 +7569,11 @@ pub const TypeInfo = union(TypeId) {
75677569 child: ?type,
75687570 };
75697571
7572 pub const Vector = struct {
7573 len: comptime_int,
7574 child: type,
7575 };
7576
75707577 pub const Definition = struct {
75717578 name: []const u8,
75727579 is_pub: bool,
......@@ -7598,6 +7605,11 @@ pub const TypeInfo = union(TypeId) {
75987605 };
75997606};
76007607 {#code_end#}
7608 <p>
7609 For {#link|structs|struct#}, {#link|unions|union#}, {#link|enums|enum#}, and
7610 {#link|error sets|Error Set Type#}, the fields are guaranteed to be in the same
7611 order as declared. For declarations, the order is unspecified.
7612 </p>
76017613 {#header_close#}
76027614
76037615 {#header_open|@typeName#}