~mil/mepo-devel

1

Re: [PATCH 2/8] Zig 0.14: Annotate API function spec types

Nguyễn Gia Phong <mcsinyx@disroot.org>
Details
Message ID
<D8C7EC08QFG5.3D9C6FI97W30X@disroot.org>
Sender timestamp
1741603407
DKIM signature
pass
Download raw message
On 2025-03-09 at 21:39+01:00, LN Liberda wrote:
> -pub const spec = .{
> +pub const spec: types.MepoFnSpec = .{

Please directly specify the type, i.e.

-pub const spec: types.MepoFnSpec = .{
+pub const spec = types.MepoFnSpec{

On 2025-03-09 at 21:39+01:00, LN Liberda wrote:
> -    const click = .{ .button = sdl_button, .clicks = clicks };
> +    const click: types.ClickInput = .{ .button = sdl_button, .clicks = clicks };

The same goes for ClickInput

On 2025-03-09 at 21:39+01:00, LN Liberda wrote:
> -        const pin_label_border = .{ .value = pin_label_border_value };
> +        const pin_label_border: types.Color = .{ .value = pin_label_border_value };

and Color.

Re: [PATCH 2/8] Zig 0.14: Annotate API function spec types

Nguyễn Gia Phong <mcsinyx@disroot.org>
Details
Message ID
<D8C7QTUSSCXN.2CIUIIMEEMB75@disroot.org>
In-Reply-To
<D8C7EC08QFG5.3D9C6FI97W30X@disroot.org> (view parent)
Sender timestamp
1741604387
DKIM signature
pass
Download raw message
On 2025-03-10 at 10:43+09:00, Nguyễn Gia Phong wrote:
> The same goes for ClickInput and Color.

I am sorry for the reply being off-thread.

On 2025-03-09 at 21:39+01:00, LN Liberda wrote:
> -            const new_timer = .{
> +            const new_timer: types.TimerInput = .{

I forgot to mention, but instances of TimerInput

On 2025-03-09 at 21:39+01:00, LN Liberda wrote:
> -    const gest = .{
> +    const gest: types.GestureInput = .{

and GestureInput should be declared similarly as well.

IMHO the type hinting syntax should be reserved
for casting and coercion.
Reply to thread Export thread (mbox)