authorgravatar for manlio.perillo@gmail.comManlio Perillo <manlio.perillo@gmail.com> 2023-01-25 09:26:41+01:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2023-01-25 23:29:25+02:00
logfcef728b9bff885c50ad06cbb1e87fb27cb43f62
tree2b46603e51affafb9cdc168a1b858978cacba65e
parent21d9f0c2a123a0939881ba55bad84e4bae990e47

langref: make "Type Coercion" subsections more consistent

In the "Type Coercion" section, rename: - Coercion Float to Int => Float to Int - unions and enums => Unions and Enums - tuples to arrays => Tuples to Arrays

1 files changed, 4 insertions(+), 4 deletions(-)

doc/langref.html.in+4-4
...@@ -3839,7 +3839,7 @@ test "simple union" {...@@ -3839,7 +3839,7 @@ test "simple union" {
3839 <p>Unions can be declared with an enum tag type.3839 <p>Unions can be declared with an enum tag type.
3840 This turns the union into a <em>tagged</em> union, which makes it eligible3840 This turns the union into a <em>tagged</em> union, which makes it eligible
3841 to use with {#link|switch#} expressions.3841 to use with {#link|switch#} expressions.
3842 Tagged unions coerce to their tag type: {#link|Type Coercion: unions and enums#}.3842 Tagged unions coerce to their tag type: {#link|Type Coercion: Unions and Enums#}.
3843 </p>3843 </p>
3844 {#code_begin|test|test_tagged_union#}3844 {#code_begin|test|test_tagged_union#}
3845const std = @import("std");3845const std = @import("std");
...@@ -6275,7 +6275,7 @@ test "float widening" {...@@ -6275,7 +6275,7 @@ test "float widening" {
6275}6275}
6276 {#code_end#}6276 {#code_end#}
6277 {#header_close#}6277 {#header_close#}
6278 {#header_open|Type Coercion: Coercion Float to Int#}6278 {#header_open|Type Coercion: Float to Int#}
6279 <p>6279 <p>
6280 A compiler error is appropriate because this ambiguous expression leaves the compiler6280 A compiler error is appropriate because this ambiguous expression leaves the compiler
6281 two choices about the coercion.6281 two choices about the coercion.
...@@ -6427,7 +6427,7 @@ test "coercing large integer type to smaller one when value is comptime-known to...@@ -6427,7 +6427,7 @@ test "coercing large integer type to smaller one when value is comptime-known to
6427}6427}
6428 {#code_end#}6428 {#code_end#}
6429 {#header_close#}6429 {#header_close#}
6430 {#header_open|Type Coercion: unions and enums#}6430 {#header_open|Type Coercion: Unions and Enums#}
6431 <p>Tagged unions can be coerced to enums, and enums can be coerced to tagged unions6431 <p>Tagged unions can be coerced to enums, and enums can be coerced to tagged unions
6432 when they are {#link|comptime#}-known to be a field of the union that has only one possible value, such as6432 when they are {#link|comptime#}-known to be a field of the union that has only one possible value, such as
6433 {#link|void#}:6433 {#link|void#}:
...@@ -6487,7 +6487,7 @@ test "coercion between unions and enums" {...@@ -6487,7 +6487,7 @@ test "coercion between unions and enums" {
6487 <p>{#link|undefined#} can be coerced to any type.</p>6487 <p>{#link|undefined#} can be coerced to any type.</p>
6488 {#header_close#}6488 {#header_close#}
64896489
6490 {#header_open|Type Coercion: tuples to arrays#}6490 {#header_open|Type Coercion: Tuples to Arrays#}
6491 <p>{#link|Tuples#} can be coerced to arrays, if all of the fields have the same type.</p>6491 <p>{#link|Tuples#} can be coerced to arrays, if all of the fields have the same type.</p>
6492 {#code_begin|test|test_coerce_tuples_arrays#}6492 {#code_begin|test|test_coerce_tuples_arrays#}
6493const std = @import("std");6493const std = @import("std");