Skip to content

Stage-A: keyword used as a parameter name gives a parse error with no location #970

Closed

Description

@godofecht

A parameter named from (a keyword) makes Stage-A flowc fail to parse, and the diagnostic gives no line, column or reason.

Repro (from_param.flow):

function link(from: i32, to: i32) -> i32 {
    return from + to
}

function main() -> i32 {
    return link(1, 2)
}
FLOWC_TYPECHECK=1 FLOWC_IN=from_param.flow FLOWC_OUT=from_param.c compiler/bootstrap/flowc_stage_a
flowc emit: parse failed
flowc emit: at 25
flowc emit: arena_len=2

In bundle mode (FLOWC_BUNDLE=1) the only output is flowc gather: parse failed, with no file or position at all. In a 1,000-line tool the failing function had to be found by bisecting top-level items.

Expected: a message naming the file, line and column, and saying that from is reserved and cannot be used as a parameter name. Allowing keywords as parameter names would also work, but the diagnostic is the main problem.

Found while porting scripts/build_wiki.py to Flow.

Activity

  1. added 2 commits that reference this issue on Sep 29, 2026
    c4a4a23
    4237995
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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions