Skip to content

analyze rejects implicit-main programs accepted by run and build #1176

Closed

Description

@ehartford

run and build accept implicit main (top-level statements), but analyze
does not use the same source preparation. This blocks using the analyzer as
the proof gate on valid scripting programs.

Repro (spec implicit-main / scripting surface):

print("ok")

Expected: with analyze repro.w audit:all analyzes the same program accepted
by with run repro.w.

Actual: error: expected declaration (fn, type, enum, let, use, extern).
Observed while reducing #1172's cleanup ordering; the valid top-level call
stop("bad,old") is rejected before analysis. Adding explicit fn main:
allows analysis and was the probe-only workaround.

Evidence: local out/with-get-investigation/return-temps-defer-audit.log
versus return-temps-defer-explicit-audit.log. No compiler fix proposed from
this characterization; locate the differing source preparation route before
implementing the repair.

Activity

  1. ehartford commented on Oct 25, 2026

    @ehartford
    ContributorAuthor

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

    $ cat main.w
    print("ok")
    $ with analyze main.w audit:all
    compiler-analysis-audit: facts=20478 violations=0 ok
    
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