Skip to content

pretty-printer does not parenthesize ret expr in callee position #891

Closed
@jruderman

Description

@jruderman
(ret g)(41)

becomes

ret g(41)

Here's an invalid program that gets transformed into a program that prints 42.

fn f(g: fn(int) -> int) -> int { (ret g)(41) }
fn succ(x: int) -> int { x + 1 }
fn main() { log_err f(succ); }

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-prettyArea: Pretty printing (including `-Z unpretty`)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions