From fcef728b9bff885c50ad06cbb1e87fb27cb43f62 Mon Sep 17 00:00:00 2001 From: Manlio Perillo Date: Wed, 25 Jan 2023 09:26:41 +0100 Subject: [PATCH] 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 --- doc/langref.html.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/langref.html.in b/doc/langref.html.in index 2137ec3e3a..fd4aa8ae76 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -3839,7 +3839,7 @@ test "simple union" {

Unions can be declared with an enum tag type. This turns the union into a tagged union, which makes it eligible to use with {#link|switch#} expressions. - Tagged unions coerce to their tag type: {#link|Type Coercion: unions and enums#}. + Tagged unions coerce to their tag type: {#link|Type Coercion: Unions and Enums#}.

{#code_begin|test|test_tagged_union#} const std = @import("std"); @@ -6275,7 +6275,7 @@ test "float widening" { } {#code_end#} {#header_close#} - {#header_open|Type Coercion: Coercion Float to Int#} + {#header_open|Type Coercion: Float to Int#}

A compiler error is appropriate because this ambiguous expression leaves the compiler two choices about the coercion. @@ -6427,7 +6427,7 @@ test "coercing large integer type to smaller one when value is comptime-known to } {#code_end#} {#header_close#} - {#header_open|Type Coercion: unions and enums#} + {#header_open|Type Coercion: Unions and Enums#}

Tagged unions can be coerced to enums, and enums can be coerced to tagged unions when they are {#link|comptime#}-known to be a field of the union that has only one possible value, such as {#link|void#}: @@ -6487,7 +6487,7 @@ test "coercion between unions and enums" {

{#link|undefined#} can be coerced to any type.

{#header_close#} - {#header_open|Type Coercion: tuples to arrays#} + {#header_open|Type Coercion: Tuples to Arrays#}

{#link|Tuples#} can be coerced to arrays, if all of the fields have the same type.

{#code_begin|test|test_coerce_tuples_arrays#} const std = @import("std");