ExpressibleByArrayLiteral

public protocol ExpressibleByArrayLiteral

User-facing protocol for array-literal lowering.

Provides a LiteralSlice view over the literal's contents so the implementation can iterate or copy without juggling raw pointers.

Initializers

init(arrayLiteral: LiteralSlice[Element])

Builds an instance from a literal slice of elements.

Implements_ExpressibleByArrayLiteral

Associated Types

type Element

Initializers

init(_arrayLiteralPointer: consuming lang.ptr[Element], _arrayLiteralCount: consuming lang.i64)

Compiler-emitted init taking a raw pointer and count.

Both params are consuming: the compiler hands ownership of the stack buffer's address (and the count) over to the implementation, which stores them in its own storage. This convention is what the MIR lowering's structural predicate looks for — implementations that deviate will be silently skipped during literal lowering.

Defined in lang/std/core/literals.ks