From 072744f1ac8f4f58a80dc6ca0e15bd4ecbb4abfb Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Thu, 2 Jul 2026 17:31:26 -0700 Subject: [PATCH] langref: remove incorrect claim in `@splat` section --- doc/langref.html.in | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/doc/langref.html.in b/doc/langref.html.in index 123ef1e2edad916ca00f45644dcc5f4f0352b009..d9312249b74737e7b985c38696ffcbee14661878 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -5474,19 +5474,14 @@ fn cmpxchgWeakButNotAtomic(comptime T: type, ptr: *T, expected_value: T, new_val {#header_close#} {#header_open|@splat#} -
{#syntax#}@splat(scalar: anytype) anytype{#endsyntax#}
+
{#syntax#}@splat(element: anytype) anytype{#endsyntax#}

Produces an array or vector where each element is the value - {#syntax#}scalar{#endsyntax#}. The return type and thus the length of the - vector is inferred. + {#syntax#}element{#endsyntax#}. The return type, including the number of + elements, is inferred.

{#code|test_splat_builtin.zig#} - -

- {#syntax#}scalar{#endsyntax#} must be an {#link|integer|Integers#}, {#link|bool|Primitive Types#}, - {#link|float|Floats#}, or {#link|pointer|Pointers#}. -

- {#see_also|Vectors|@shuffle#} + {#see_also|Vectors|Arrays|@shuffle#} {#header_close#} {#header_open|@reduce#} -- 2.54.0