Skip to content

Compiler-source into_iter() specializations undefined at stage1 link (cross-unit generic emission; check passes) #926

Closed

Description

@ehartford

Found in the #921 campaign: adding two ordinary D33 consuming loops to src/main.w

for line in text.split("\n").into_iter():
    if line.len() > 0:
        out.push(line)

passes with check src/main.w but fails with build :dev at link:

error: ld64.lld: error: undefined symbol: _VecIntoIter.next__receiver__10129_16
ld64.lld: error: undefined symbol: _Vec.into_iter__receiver__128_16

The identical shape as a user program (with run, Vec[str] from split, owned element push) compiles, links, and runs — so this is not a D33 surface gap but a generic-specialization emission gap somewhere in the compiler's own multi-unit build path (stage objects / no-c-export split): the Vec[str] into_iter/VecIntoIter.next instantiations are referenced from main.w's unit but emitted in none.

Also the second bite of the "check gate is blind to missing symbols" class (the gate that motivated :dev-before-commit discipline): with check green, first failure at ld.

Workaround in c4c2a40-follow-up: indexed loops in the two compiler-source sites (build_runner_load_fallback / build_runner_read_effects). Remove it when this is fixed — compiler source should get to use the language's own iteration surface.

Repro: add the loop above to any src/main.w function, with build :dev.

Activity

  1. ehartford commented on Oct 25, 2026

    @ehartford
    ContributorAuthor

    Triage 2026-10-25, with v0.15.3.0 (main a261b65): does not reproduce.

    The compiler's own multi-unit build now links consuming into_iter() loops: src/ComptimeEval.w has three for elem in elems.into_iter(): loops (added by #2151, after this report), and main's release build and reseed at a261b65 linked them. Cross-unit specialization ownership landed in #1325 and was pinned by #1360. The user-program shape still runs:

    $ with run repro/926/main.w   # for line in text.split("\n").into_iter(): out.push(line)
    2
    
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