Skip to content

Three compiler sources import StringBuilder explicitly (§18.1); exposes #1955 - #1957

Closed
ehartford wants to merge 1 commit into
mainfrom
fix-std-imports
Closed

ehartford wants to merge 1 commit into
mainfrom
fix-std-imports

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

src/main.w, src/CodegenDispatch.w and src/compiler/Frontend.w used StringBuilder without use std.string.StringBuilder; it only resolved because an imported module's own import leaks through lookup_named_type_filtered's global fallback when that module's bodies are checked first — #1955, which makes check src\main.w and check W:/…/src/main.w disagree on win10. This is the §18.1-compliant spelling regardless of the #1955 fix. :dev and gate green on 30f89aa. Battery with the next batch.

…1955)

src/main.w, src/CodegenDispatch.w and src/compiler/Frontend.w use
StringBuilder with no import. They compile only through the order-dependent
leak #1955 describes (a bare `use compiler.Link` exposes Link's own
`use std.string.StringBuilder` to the importer when Link's bodies are
checked first). On win10 the leak does not happen for the backslash
spelling of the path:

    > out\bootstrap\bin\with-stage1.exe check src\main.w
    error: 'StringBuilder' requires an explicit import (§18.1); add: use std.string.StringBuilder
     --> src\main.w:547:15
    > out\bootstrap\bin\with-stage1.exe check W:/verify-2/src/main.w
    ok

The explicit import is what §18.1 requires; the leak itself is #1955.
@ehartford

Copy link
Copy Markdown
Contributor Author

Superseded by #1955's branch (fix-1955), which includes f301fdc and fixes the leak itself.

@ehartford ehartford closed this Oct 2, 2026
@ehartford
ehartford deleted the fix-std-imports branch October 4, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant