| ... | @@ -5142,11 +5142,11 @@ test "float widening" { | ... | @@ -5142,11 +5142,11 @@ test "float widening" { |
| 5142 | <p> | 5142 | <p> |
| 5143 | A compiler error is appropriate because this ambiguous expression leaves the compiler | 5143 | A compiler error is appropriate because this ambiguous expression leaves the compiler |
| 5144 | two choices about the coercion. | 5144 | two choices about the coercion. |
| | 5145 | </p> |
| 5145 | <ul> | 5146 | <ul> |
| 5146 | <li> Cast {#syntax#}54.0{#endsyntax#} to {#syntax#}comptime_int{#endsyntax#} resulting in {#syntax#}@as(comptime_int, 10){#endsyntax#}, which is casted to {#syntax#}@as(f32, 10){#endsyntax#}</li> | 5147 | <li> Cast {#syntax#}54.0{#endsyntax#} to {#syntax#}comptime_int{#endsyntax#} resulting in {#syntax#}@as(comptime_int, 10){#endsyntax#}, which is casted to {#syntax#}@as(f32, 10){#endsyntax#}</li> |
| 5147 | <li> Cast {#syntax#}5{#endsyntax#} to {#syntax#}comptime_float{#endsyntax#} resulting in {#syntax#}@as(comptime_float, 10.8){#endsyntax#}, which is casted to {#syntax#}@as(f32, 10.8){#endsyntax#}</li> | 5148 | <li> Cast {#syntax#}5{#endsyntax#} to {#syntax#}comptime_float{#endsyntax#} resulting in {#syntax#}@as(comptime_float, 10.8){#endsyntax#}, which is casted to {#syntax#}@as(f32, 10.8){#endsyntax#}</li> |
| 5148 | </ul> | 5149 | </ul> |
| 5149 | </p> | | |
| 5150 | {#code_begin|test_err#} | 5150 | {#code_begin|test_err#} |
| 5151 | // Compile time coercion of float to int | 5151 | // Compile time coercion of float to int |
| 5152 | test "implicit cast to comptime_int" { | 5152 | test "implicit cast to comptime_int" { |