Skip to content

flowc: print(x) takes x's type from a same-named parameter of another function #993

Closed

Description

@godofecht

The flowc print intrinsic resolves a variable's type by name across the whole module, so a parameter in one function can decide the printf format in another.

function show(tag: string) {
    print(tag)
    println("")
}

function count(tag: i32) -> i32 {
    return tag + 1
}

function main() -> i32 {
    show("hello")
    return count(0) - 1
}

flowc emits printf("%d", tag); inside show, so the program prints a pointer value (45237528) instead of hello. Renaming count's parameter makes it print hello. The Python host prints hello.

Seen in examples/circuits/rc_rl_rlc.flow while checking flow-block programs on flowc (#681): row(name: string, method: string, ...) prints method as a number because mna_rc(method: i32, dt: f64) is declared later in the file.

Expected: the print intrinsic looks the name up in the enclosing function's scope (locals, then parameters) before module-level declarations.

Activity

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