Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Example from #1458 no longer parses #3861

Closed
catamorphism opened this Issue Oct 25, 2012 · 1 comment

Comments

Projects
None yet
1 participant
Contributor

catamorphism commented Oct 25, 2012

The example from a comment in #1458, which compiled but didn't pretty-print correctly, no longer compiles:

fn plus_one(f: fn() -> int) -> int {
  return f() + 1;
}

fn ret_plus_one() -> fn(fn() -> int) -> int {
  return plus_one;
}

fn main() {
    let z = do ret_plus_one() || { 2 };
    assert z == 3;
}
issue-1458.rs:10:15: 10:32 error: this function takes 0 parameters but 1 parameter was supplied
issue-1458.rs:10     let z = do ret_plus_one() || { 2 };
                                                                          ^~~~~~~~~~~~~~~~~
issue-1458.rs:10:28: 10:38 error: Non-function passed to a `do` function as its last argument, or wrong number of arguments passed to a `do` function
issue-1458.rs:10     let z = do ret_plus_one() || { 2 };
Contributor

catamorphism commented Oct 30, 2012

Fixed in 4e5865

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment