VOID Language value types & control flow

Value types that compose.
Control flow that holds up.

VOID now handles nested and readonly value layouts, jagged and rectangular arrays, null-conditional indexing, explicit and inferred rectangular initializers, escaped closures, richer iterator state machines, compound targets, and managed references across those features as one coherent language/runtime surface.

Completed value-type & control-flow foundation

Everyday game code without the old deferred walls.

The completed integration pass combines value layouts, arrays, closures, iterators, unsafe members, compound targets, and forced GC in one normal multi-file project through check, build, run, and publish.

Nested value structs

Structs can contain other value structs normally. Layout, default values, copying, generics, arrays, nullable wrappers, static storage, and recursive GC tracing all understand nested value layouts.

Readonly structs

readonly struct, readonly instance methods/accessors, readonly fields, and calls through in parameters preserve value semantics without hidden mutation.

Jagged arrays

Recursive array-of-array types such as T[][] and deeper forms support allocation, initialization, nested indexing, foreach, generics, nullable inner arrays, and managed elements.

Rectangular arrays

Real multidimensional arrays support rank, dimensions, indexing, iteration, GC-aware elements, and nested typed initializer braces such as new int[,] { { 1, 2 }, { 3, 4 } } with inferred shape, row-major layout, conversions, and ragged-shape diagnostics.

Nested closures

Closures can live inside other closures, and foreach captures receive proper per-iteration frames so escaped delegates keep the value from the iteration that created them.

By-reference closure capture

Closures can capture ref, out, and in parameters. Delegate lambdas can use by-reference parameters, while struct instance methods can safely capture struct this.

Iterator completion

Iterator state machines preserve ordinary local inference, definite assignment, nested/sibling shadowing, managed roots, control flow across yield, foreach, switch, loops, and base-member access, plus exception propagation and finally cleanup across suspension/resume.

Unsafe pointer members

Unsafe types can expose pointer properties and constructors, including pointer ref/out/in parameters, without weakening the existing unsafe project/type boundaries.

Rectangular initializer completion

Rectangular arrays can combine explicit compile-time dimensions with nested values or infer their dimensions directly from new[,]-style initializers, while preserving rank/shape validation, conversions, evaluation order, and managed-element tracing.

Null-conditional arrays

?[] works across one-dimensional, jagged, and higher-rank rectangular arrays with nullable lifting, short-circuiting, chained element access, single evaluation, and skipped index expressions when the receiver is null.

Compound targets

Compound assignment works through indexers and writable vector swizzles while preserving single evaluation of receivers, indices, and right-hand sides.

GC-aware composition

Managed references remain traceable when buried inside nested value structs, arrays, closure frames, iterator state, nullable values, static roots, and combinations of those structures.

Integrated behavior

The hard part is the composition.

A readonly struct can sit inside a nested mutable value layout that contains a managed object, move through jagged or rectangular arrays, escape through a closure, survive iterator suspension and forced GC, then participate in compound indexer updates in the same project. The completed integration pass proves those paths together rather than as isolated syntax demos.