Skip to content

Example from #1458 no longer parses #3861

New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Example from #1458 no longer parses #3861

catamorphism opened this issue Oct 25, 2012 · 1 comment
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR)
Milestone

Comments

@catamorphism
Copy link
Contributor

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 };
@catamorphism
Copy link
Contributor Author

Fixed in 4e5865

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR)
Projects
None yet
Development

No branches or pull requests

1 participant