Skip to content

Implement skipped test: test/spec/spec_ss18_6_collection_length_methods.w #282

Closed

Description

@ehartford

Skipped test: test/spec/spec_ss18_6_collection_length_methods.w

Skip reason: non-executable spec sketch for Section 18.6 — Collection Length Methods (formerly 25.47); contains pseudo-code for unimplemented feature work

Implementation is required. This issue tracks replacing the skipped test with executable coverage and removing the //! skip: directive.

Acceptance criteria:

  • Implement the compiler/runtime/stdlib behavior required by this test, or split the spec sketch into concrete executable positive/negative tests.
  • Remove the //! skip: directive from test/spec/spec_ss18_6_collection_length_methods.w.
  • The test runs under make test and is not counted as skipped.

Activity

  1. ehartford commented on May 30, 2026

    @ehartford
    ContributorAuthor

    Length-method portion implemented. len / len32 / len64 / ulen32 now lower through MirIntrinsic for Vec, HashMap, str, and array:

    • Sema return types: usize / i32 / i64 / u32 respectively.
    • len32/ulen32 panic at runtime if the length exceeds i32/u32 range.
    • Both backends: LLVM (mir_convert_len_method_result) and C (CCodegen.emit_len_result, wired into all four families).
    • The skipped sketch is replaced with executable coverage: test/spec/spec_ss18_6_collection_length_methods.w (7 tests), //! skip: removed.

    Verified: build + fixpoint + full test suite green; runtime-verified on LLVM; C emission verified to narrow correctly (no bare len32() calls).

    Caveat: SlotMap/VecRange len* variants work on LLVM but not the C backend — tracked in #301. Changes are currently uncommitted in the working tree.

  2. ehartford commented on May 30, 2026

    @ehartford
    ContributorAuthor

    Implemented in commit d74ce9a (local main, pending push).

    len / len32 / len64 / ulen32 are implemented for Vec, HashMap, str, and array — Sema return types (usize/i32/i64/u32), MirIntrinsic lowering, both LLVM and C backends, with i32/u32 overflow narrowing. The skipped sketch test/spec/spec_ss18_6_collection_length_methods.w is now executable (7 tests) and the //! skip: directive is removed.

    Verified: build + fixpoint + full test suite green.

    Note: SlotMap/VecRange len* variants are LLVM-only on the C backend — tracked separately in #301.

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

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions