Skip to content

Associated types of supertraits aren't accepted or completed in impl Subtrait<...> #12166

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
jonas-schievink opened this issue May 5, 2022 · 1 comment · Fixed by #12198
Closed
Labels
A-completion autocompletion A-ide general IDE features A-nameres name, path and module resolution A-ty type system / type inference / traits / method resolution C-bug Category: bug S-actionable Someone could pick this issue up and work on it right now

Comments

@jonas-schievink
Copy link
Contributor

trait Super {
    type AssocSuper;
}

trait Sub: Super {
    type AssocSub;
}

fn f() -> impl Sub<AssocSuper = ()> {}

Here in the impl Sub<...> the AssocSuper remains an unresolved reference, but rustc has no problem with this code. AssocSuper is also not completed, while AssocSub is.

@jonas-schievink jonas-schievink added A-ty type system / type inference / traits / method resolution A-completion autocompletion S-actionable Someone could pick this issue up and work on it right now A-nameres name, path and module resolution C-bug Category: bug labels May 5, 2022
@jonas-schievink
Copy link
Contributor Author

Ah, this is an IDE-only problem, the assoc. type does get set correctly as far as the type-checker is concerned

@jonas-schievink jonas-schievink added the A-ide general IDE features label May 9, 2022
bors added a commit that referenced this issue May 9, 2022
…ypes, r=jonas-schievink

fix: Resolve assoc. types of supertraits in the IDE layer

Fixes #12166
@bors bors closed this as completed in ab55805 May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-completion autocompletion A-ide general IDE features A-nameres name, path and module resolution A-ty type system / type inference / traits / method resolution C-bug Category: bug S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant