Literal types
Nick Treleaven
nick at geany.org
Sat Jul 5 15:48:43 UTC 2025
On Saturday, 5 July 2025 at 10:50:13 UTC, Nick Treleaven wrote:
> On Friday, 4 July 2025 at 16:16:05 UTC, IchorDev wrote:
>> ubyte[] c = [1,2]; //OK: on second thought, `[1,2]` can
>> totally be a `ubyte[]`…
>> ```
>> One thing that could mitigate this is having explicit suffixes
>> for char, byte, and short.
>
> You can write `cast(ubyte) [1, 2]`:
I meant `cast(ubyte[]) [1, 2]`.
> https://dlang.org/spec/expression.html#cast_array_literal
More information about the dip.ideas
mailing list