Skip to content

with check rejects an implicit-main file that with run and with build accept ("expected declaration" at the first top-level statement) #1759

Closed

Description

@ehartford

Spec/docs: implicit main — a .w file needs no fn main; top-level statements are the program (CLAUDE.md "Implicit main", §18.5b one-liners).

use std.process
print("hi")
$ with run im.w
hi
$ with check im.w
error: expected declaration (fn, type, enum, let, use, extern)
 --> im.w:2:1

with build im.w -o x also accepts it. Only check parses the file as a plain module, so every With tool script (tools/*.w) can't be type-checked with with check, which is the iterate tier's cheapest command. Found while writing tools/battery.w. Expected: check applies the same implicit-main rule as run/build to an entry file.

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