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" {
38393839 <p>Unions can be declared with an enum tag type.
38403840 This turns the union into a <em>tagged</em> union, which makes it eligible
38413841 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#}.
38433843 </p>
38443844 {#code_begin|test|test_tagged_union#}
38453845const std = @import("std");
......@@ -6275,7 +6275,7 @@ test "float widening" {
62756275}
62766276 {#code_end#}
62776277 {#header_close#}
6278 {#header_open|Type Coercion: Coercion Float to Int#}
6278 {#header_open|Type Coercion: Float to Int#}
62796279 <p>
62806280 A compiler error is appropriate because this ambiguous expression leaves the compiler
62816281 two choices about the coercion.
......@@ -6427,7 +6427,7 @@ test "coercing large integer type to smaller one when value is comptime-known to
64276427}
64286428 {#code_end#}
64296429 {#header_close#}
6430 {#header_open|Type Coercion: unions and enums#}
6430 {#header_open|Type Coercion: Unions and Enums#}
64316431 <p>Tagged unions can be coerced to enums, and enums can be coerced to tagged unions
64326432 when they are {#link|comptime#}-known to be a field of the union that has only one possible value, such as
64336433 {#link|void#}:
......@@ -6487,7 +6487,7 @@ test "coercion between unions and enums" {
64876487 <p>{#link|undefined#} can be coerced to any type.</p>
64886488 {#header_close#}
64896489
6490 {#header_open|Type Coercion: tuples to arrays#}
6490 {#header_open|Type Coercion: Tuples to Arrays#}
64916491 <p>{#link|Tuples#} can be coerced to arrays, if all of the fields have the same type.</p>
64926492 {#code_begin|test|test_coerce_tuples_arrays#}
64936493const std = @import("std");