diff options
| author | Tadeo Kondrak <me@tadeo.ca> | 2021-01-11 11:04:38 -0700 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2021-01-30 13:19:58 +0200 |
| commit | 1637d8ac80b46599e276eb767208f54f0a30ccf0 (patch) | |
| tree | 1990400fd1d63579cff6e552f91d7139513e6c49 /doc | |
| parent | b7767eb834084adc9db94b9ed961aaa2756fc018 (diff) | |
| download | zig-1637d8ac80b46599e276eb767208f54f0a30ccf0.tar.gz zig-1637d8ac80b46599e276eb767208f54f0a30ccf0.zip | |
remove @TagType
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/langref.html.in | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/doc/langref.html.in b/doc/langref.html.in index 85917680d3..3af4d7d2b1 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -3092,8 +3092,7 @@ test "simple union" { {#header_open|Tagged union#} <p>Unions can be declared with an enum tag type. This turns the union into a <em>tagged</em> union, which makes it eligible - to use with {#link|switch#} expressions. One can use {#link|@TagType#} to - obtain the enum type from the union type. + to use with {#link|switch#} expressions. Tagged unions coerce to their tag type: {#link|Type Coercion: unions and enums#}. </p> {#code_begin|test#} @@ -3119,8 +3118,8 @@ test "switch on tagged union" { } } -test "@TagType" { - expect(@TagType(ComplexType) == ComplexTypeTag); +test "get tag type" { + expect(std.meta.Tag(ComplexType) == ComplexTypeTag); } test "coerce to enum" { @@ -7740,7 +7739,7 @@ test "@hasDecl" { {#header_close#} {#header_open|@intToEnum#} - <pre>{#syntax#}@intToEnum(comptime DestType: type, int_value: @TagType(DestType)) DestType{#endsyntax#}</pre> + <pre>{#syntax#}@intToEnum(comptime DestType: type, int_value: std.meta.Tag(DestType)) DestType{#endsyntax#}</pre> <p> Converts an integer into an {#link|enum#} value. </p> @@ -8435,16 +8434,6 @@ fn doTheTest() void { </p> {#header_close#} - {#header_open|@TagType#} - <pre>{#syntax#}@TagType(T: type) type{#endsyntax#}</pre> - <p> - For an enum, returns the integer type that is used to store the enumeration value. - </p> - <p> - For a union, returns the enum type that is used to store the tag value. - </p> - {#header_close#} - {#header_open|@This#} <pre>{#syntax#}@This() type{#endsyntax#}</pre> <p> |
