Skip to content

Chapter 8 (modules) has no conformance programs #679

@aallan

Description

@aallan

Finding

The conformance suite at tests/conformance/ has 86 programs across chapters 1, 2, 3, 4, 5, 6, 7, 9, and 10. There is no ch08_*.vera program — Chapter 8 (modules) is the only gap.

Chapter 8 specifies module declaration, selective and wildcard imports, public/private visibility, :: module-qualified call syntax, shadowing rules, file-system resolution, and circular-import detection. All of this is well-tested at the codegen layer (23 tests in tests/test_codegen_modules.py), but the conformance-suite program-per-feature mapping is missing.

examples/modules.vera exists and exercises the full surface in a single program. The substrate is ready.

Suggested fix

Eight small conformance programs, one per spec section, with manifest entries carrying the correct spec_ref:

File Spec section Feature
ch08_module_decl.vera §8.2 module vera.foo; declaration
ch08_import_wildcard.vera §8.3.1 wildcard import
ch08_import_selective.vera §8.3.2 selective import
ch08_visibility_public.vera §8.4 public fn visibility
ch08_visibility_private.vera §8.4 private fn not importable
ch08_shadowing.vera §8.5.2 local definition shadows import
ch08_module_qualified_call.vera §8.5.3 vera.math::abs(x) syntax
ch08_circular_import.vera §8.6.3 cycle detection diagnostic

Some will need companion files (e.g. vera/math.vera) in the conformance subdirectory. The manifest schema already supports this — see examples/modules.vera and the vera/math.vera / vera/collections.vera files it imports.

The circular_import program should be at level: check and expected to fail with a specific diagnostic, mirroring the pattern used for other negative conformance tests.

Acceptance criteria

  1. At least eight ch08_*.vera programs in tests/conformance/, each with a manifest entry carrying a spec_ref
  2. Each program exercises one spec section, with a comment header naming the section
  3. The negative test (ch08_circular_import.vera) is at level: check and asserts the expected E-code is emitted
  4. python scripts/check_conformance.py runs them as part of the existing harness without bespoke wiring
  5. pytest tests/test_conformance.py (or equivalent) covers them

Estimated effort

A day. Programs are small; companion module files are small.

Origin

Surfaced by a strategic compiler review on 2026-05-18 (v0.0.155). The implementation is solid (#127 module re-exports the only open module-system bug, separately tracked); the gap is conformance-coverage, not behaviour.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions