Skip to content

fix(cgen): array literals as values and null for every span spelling (#1050, #1048) - #1090

Merged
godofecht merged 2 commits into
mainfrom
fix/array-literal-values
Sep 30, 2026
Merged

godofecht merged 2 commits into
mainfrom
fix/array-literal-values

Conversation

@godofecht

Copy link
Copy Markdown
Contributor

Ports the two fixes in #1081 that #1082 did not cover, with their tests.

Tests, from #1081: tests/lang/test_array_literal_value.flow, tests/lang/test_static_span_null_forms.flow and the tests/cgen/array_literal_value golden. Both lang tests failed on main before this change.

Local gates: bootstrap fixed point, self_host_full, roundtrip, cgen 107/0, test-lang 230, every parity gate (parity_shader_dsl only at its Metal step, as always on this Mac), parity_typecheck, typecheck_rules, conformance, mlir_commands 72/72, fuzz, corpus parity and the ratchet.

…1050, #1048)

Ported from #1081, the parts #1082 did not cover:

- An array literal indexed, cast or measured gets a compound literal's
  type, (int32_t[]){ ... }, since a bare initializer list is not a C
  expression. let a = [1, 2, 3] takes its element type and dimensions
  from the literal, and a statement-level literal evaluates nested rows
  (#1050).
- A module static of type &[T] or &mut [T] initialised from null is the
  empty span, as span<T> already was (#1048).

Tests from #1081: tests/lang/test_array_literal_value.flow,
tests/lang/test_static_span_null_forms.flow and the
tests/cgen/array_literal_value golden.
@godofecht
godofecht merged commit a39c796 into main Sep 30, 2026
34 checks passed
@godofecht
godofecht deleted the fix/array-literal-values branch October 1, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant