diff --git a/doc/langref.html.in b/doc/langref.html.in index 4ac9cf47e0..e244d69e25 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -550,7 +550,7 @@ pub fn main() void { {#syntax#}i7{#endsyntax#} refers to a signed 7-bit integer. The maximum allowed bit-width of an integer type is {#syntax#}65535{#endsyntax#}.

- {#see_also|Integers|Floats|void|Errors|@IntType#} + {#see_also|Integers|Floats|void|Errors|@Type#} {#header_close#} {#header_open|Primitive Values#}
@@ -2810,14 +2810,10 @@ test "@TagType" { assert(@TagType(Small) == u2); } -// @memberCount tells how many fields an enum has: -test "@memberCount" { - assert(@memberCount(Small) == 4); -} - -// @memberName tells the name of a field in an enum: -test "@memberName" { - assert(mem.eql(u8, @memberName(Small, 1), "Two")); +// @typeInfo tells us the field count and the fields names: +test "@typeInfo" { + assert(@typeInfo(Small).Enum.fields.len == 4); + assert(mem.eql(u8, @typeInfo(Small).Enum.fields[1].name, "Two")); } // @tagName gives a []const u8 representation of an enum value: @@ -2825,7 +2821,7 @@ test "@tagName" { assert(mem.eql(u8, @tagName(Small.Three), "Three")); } {#code_end#} - {#see_also|@memberName|@memberCount|@tagName|@sizeOf#} + {#see_also|@typeInfo|@tagName|@sizeOf#} {#header_open|extern enum#}

@@ -6671,18 +6667,6 @@ comptime {

{#see_also|Alignment#} {#header_close#} - {#header_open|@ArgType#} -
{#syntax#}@ArgType(comptime T: type, comptime n: usize) type{#endsyntax#}
-

- This builtin function takes a function type and returns the type of the parameter at index {#syntax#}n{#endsyntax#}. -

-

- {#syntax#}T{#endsyntax#} must be a function type. -

-

- Note: This function is deprecated. Use {#link|@typeInfo#} instead. -

- {#header_close#} {#header_open|@as#}
{#syntax#}@as(comptime T: type, expression) T{#endsyntax#}
@@ -6816,7 +6800,7 @@ async fn func(y: *i32) void { Asserts that {#syntax#}@sizeOf(@TypeOf(value)) == @sizeOf(DestType){#endsyntax#}.

- Asserts that {#syntax#}@typeId(DestType) != @import("builtin").TypeId.Pointer{#endsyntax#}. Use {#syntax#}@ptrCast{#endsyntax#} or {#syntax#}@intToPtr{#endsyntax#} if you need this. + Asserts that {#syntax#}@typeInfo(DestType) != .Pointer{#endsyntax#}. Use {#syntax#}@ptrCast{#endsyntax#} or {#syntax#}@intToPtr{#endsyntax#} if you need this.

Can be used for these things for example: @@ -7269,7 +7253,7 @@ test "main" {

Floored division. Rounds toward negative infinity. For unsigned integers it is the same as {#syntax#}numerator / denominator{#endsyntax#}. Caller guarantees {#syntax#}denominator != 0{#endsyntax#} and - {#syntax#}!(@typeId(T) == builtin.TypeId.Int and T.is_signed and numerator == std.math.minInt(T) and denominator == -1){#endsyntax#}. + {#syntax#}!(@typeInfo(T) == .Int and T.is_signed and numerator == std.math.minInt(T) and denominator == -1){#endsyntax#}.