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) {...@@ -7448,6 +7448,8 @@ pub const TypeInfo = union(TypeId) {
7448 ArgTuple: void,7448 ArgTuple: void,
7449 Opaque: void,7449 Opaque: void,
7450 Promise: Promise,7450 Promise: Promise,
7451 Vector: Vector,
7452 EnumLiteral: void,
74517453
74527454
7453 pub const Int = struct {7455 pub const Int = struct {
...@@ -7465,11 +7467,13 @@ pub const TypeInfo = union(TypeId) {...@@ -7465,11 +7467,13 @@ pub const TypeInfo = union(TypeId) {
7465 is_volatile: bool,7467 is_volatile: bool,
7466 alignment: comptime_int,7468 alignment: comptime_int,
7467 child: type,7469 child: type,
7470 is_allowzero: bool,
74687471
7469 pub const Size = enum {7472 pub const Size = enum {
7470 One,7473 One,
7471 Many,7474 Many,
7472 Slice,7475 Slice,
7476 C,
7473 };7477 };
7474 };7478 };
74757479
...@@ -7510,9 +7514,7 @@ pub const TypeInfo = union(TypeId) {...@@ -7510,9 +7514,7 @@ pub const TypeInfo = union(TypeId) {
7510 value: comptime_int,7514 value: comptime_int,
7511 };7515 };
75127516
7513 pub const ErrorSet = struct {7517 pub const ErrorSet = ?[]Error;
7514 errors: []Error,
7515 };
75167518
7517 pub const EnumField = struct {7519 pub const EnumField = struct {
7518 name: []const u8,7520 name: []const u8,
...@@ -7567,6 +7569,11 @@ pub const TypeInfo = union(TypeId) {...@@ -7567,6 +7569,11 @@ pub const TypeInfo = union(TypeId) {
7567 child: ?type,7569 child: ?type,
7568 };7570 };
75697571
7572 pub const Vector = struct {
7573 len: comptime_int,
7574 child: type,
7575 };
7576
7570 pub const Definition = struct {7577 pub const Definition = struct {
7571 name: []const u8,7578 name: []const u8,
7572 is_pub: bool,7579 is_pub: bool,
...@@ -7598,6 +7605,11 @@ pub const TypeInfo = union(TypeId) {...@@ -7598,6 +7605,11 @@ pub const TypeInfo = union(TypeId) {
7598 };7605 };
7599};7606};
7600 {#code_end#}7607 {#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>
7601 {#header_close#}7613 {#header_close#}
76027614
7603 {#header_open|@typeName#}7615 {#header_open|@typeName#}