Skip to content

Complete empty-struct edge coverage #100

Description

@itsfuad

Current state

Core empty structural behavior is implemented and accepted:

let marker: struct {} = .{};

Anonymous struct {} types and .{} values parse, typecheck, lower through HIR/MIR/LLVM, link, and run. Dedicated x_test/runtime_empty_struct coverage exercises locals, parameters, returns, aggregate fields, fixed arrays, and references. Named empty structs are also covered by x_test/runtime_interface_nested.

Empty structural types remain structural values, not nominal namespaces. Empty enum payload schemas remain distinct from payloadless enum cases.

Remaining scope

  • Add explicit backend layout and ABI assertions for 32-bit and 64-bit targets.
  • Verify constants, statics, owned pointers, dynamic arrays/slices, and address identity where applicable.
  • Prove ownership and cleanup plans add no phantom drop work.
  • Reject or explicitly define recursive anonymous by-value shapes before lowering.
  • Preserve stable type text, fingerprints, interning, hover, and diagnostics while extending this matrix.

Validation already completed

  • GOCACHE=/tmp/peeper-go-cache CCACHE_DISABLE=1 scripts/build.sh
  • GOCACHE=/tmp/peeper-go-cache CCACHE_DISABLE=1 PEEPER_BIN="$PWD/build/bin/peeper" go test -count=1 ./x_test

This issue now tracks edge coverage only; it no longer claims core empty structs are unsupported.

Activity

  1. changed the title [-]Define zero-sized empty structs and anonymous structural values[/-] [+]Complete empty-struct edge coverage[/+] on Aug 28, 2026
  2. moved this from Todo to In Progress in Peeper Roadmapon Aug 28, 2026
  3. itsfuad commented on Aug 28, 2026

    @itsfuad
    MemberAuthor

    Completed empty-struct edge coverage on branch feature/empty-struct-edge-coverage. Added LLVM layout/function ABI checks for 386 and amd64 with clang validation, stable IR and semantic fingerprint checks, cleanup and recursive-alias regressions, runtime owned-pointer/dynamic-array/slice/address coverage, and explicit negative coverage for move-only module constants. No production compiler defect was found, so production code remains unchanged. Validation passed: scripts/build.sh, go test ./..., and full x_test with bundled build/bin/peeper. Changes remain uncommitted pending approval.

  4. moved this from In Progress to Done in Peeper Roadmapon Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions