Skip to content

Associated types are highlighted as unresolved references #8435

New issue

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

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

Already on GitHub? # to your account

Closed
lunacookies opened this issue Apr 9, 2021 · 5 comments
Closed

Associated types are highlighted as unresolved references #8435

lunacookies opened this issue Apr 9, 2021 · 5 comments
Labels
A-nameres name, path and module resolution S-actionable Someone could pick this issue up and work on it right now

Comments

@lunacookies
Copy link
Contributor

The dark red in the following screenshot represents unresolved references:

Screen Shot 2021-04-09 at 1 34 17 pm

Curiously, this example from #6995 works fine in the method definition, but not the implementation:

Screen Shot 2021-04-09 at 1 41 08 pm

Possibly related: #5003, #6995, #8283

Output of Show RA Version: nightly-50-g354151df3

@Veykril Veykril added A-nameres name, path and module resolution S-actionable Someone could pick this issue up and work on it right now labels Apr 9, 2021
@Veykril
Copy link
Member

Veykril commented Apr 9, 2021

The Self::Bar in the fn foo(_: Self::Bar) line in the latter screenshot does resolve for me, just not to i32 but to the general type alias of the trait definition(which I think is another issue with us not being able to resolve back to trait impls yet).

The code in your first screenshot uses inherent type aliases which aren't stable, I don't think RA even handles those at all aside from parsing. At least for name classification we don't expect those.

@lunacookies
Copy link
Contributor Author

@Veykril

does resolve for me, just not to i32 but to the general type alias of the trait definition

That is curious. What version of r-a are you on?

The code in your first screenshot uses inherent type aliases which aren’t stable

Oops, you’re right! Here’s a version that does compile but still has unresolved references:

Screen Shot 2021-04-10 at 10 31 13 am

@Veykril
Copy link
Member

Veykril commented Apr 10, 2021

image
I'm on the latest nightly.

Your other screenshot seems to be the same as #8282, though I guess the title there can be improved

@lunacookies
Copy link
Contributor Author

Your other screenshot seems to be the same as #8282

Hmm, you’re right, I didn’t see that issue. Should I close this because there seem to already be issues for a number of different cases regarding associated types?

@Veykril
Copy link
Member

Veykril commented Apr 10, 2021

If that's the only problem left then I'd say yes let's close this

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-nameres name, path and module resolution S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

No branches or pull requests

2 participants