Skip to content
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

Trait methods with body and >1 unnamed parameters are wrongly rejected by resolve #34074

Closed
petrochenkov opened this issue Jun 4, 2016 · 1 comment · Fixed by #34095
Closed

Comments

@petrochenkov
Copy link
Contributor

Reproduces on stable/beta/nightly.

trait Tr {
    // error: identifier `` is bound more than once in this parameter list
    fn f(u8, u8) {}
}

fn main() {
}
@eddyb
Copy link
Member

eddyb commented Jun 4, 2016

I expect it parses as <invalid>: u8, <invalid>: u8 and it might lower to HIR as _: u8, _: u8 although nothing should care at that point about the argument list.
However, resolve running on AST, it has to treat <invalid> (the empty identifier) as _.

bors added a commit that referenced this issue Jun 9, 2016
Improvements to pattern resolution + some refactoring

Continuation of #33929
First commit is a careful rewrite of `resolve_pattern`, pattern path resolution and new binding creation logic is factored out in separate functions, some minor bugs are fixed. Also, `resolve_possibly_assoc_item` doesn't swallow modules now.
Later commits are refactorings, see the comment descriptions.

I intend to continue this work later with better support for `Def::Err` in patterns in post-resolve stages and cleanup of pattern resolution code in type checker.

Fixes #32086
Fixes #34047 ([breaking-change])
Fixes #34074

cc @jseyfried
r? @eddyb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants