Skip to content

Pipe operator with module-qualified calls produces spurious E201 #326

@aallan

Description

@aallan

Bug

The pipe operator does not correctly desugar when the RHS is a module-qualified call. The LHS value is not injected as the first argument.

Reproducer:

import util;
private fn f(@Int -> @Int)
  requires(true) ensures(true) effects(pure)
{ @Int.0 |> util::inc() }

Given util exports fn inc(@Int -> @Int), this should desugar to util::inc(@Int.0) but instead produces:

error: Function 'inc' expects 1 argument(s), got 0. (E201)

Non-module-qualified pipes work correctly:

private fn f(@Int -> @Int)
  requires(true) ensures(true) effects(pure)
{ @Int.0 |> inc() }

Root cause

The pipe desugaring (likely in transform.py) handles FnCall nodes but not ModuleCall nodes, so the LHS argument is not inserted for module-qualified calls.

Impact

Low — workaround is to use direct call syntax util::inc(@Int.0) instead of pipe. Discovered during PR #325 (test coverage improvements).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions