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

Required associated type syntax in trait definition inconsisten with RFC. #19154

Closed
nulldatamap opened this issue Nov 20, 2014 · 2 comments
Closed
Labels
A-associated-items Area: Associated items such as associated types and consts.

Comments

@nulldatamap
Copy link

The RFC defines the syntax as following:

trait MyTrait {
  type A;
  fn a() -> A;
}

This syntax in practice causes an "undefined type A" error.
Self::A, MyTrait::A, <MyTrait>::A all fail, but <MyTrait as MyTrait>::A and <Self as MyTrait>::A succeeds.

Even if the syntax is supposed not to follow the RFC strictly, this is still both ugly, clunky and not very intuitive.

@quantheory
Copy link
Contributor

Agreed, but there is a lot of work still in progress for associated types, so I hope that this will be fixed soon-ish. Also, I think that this is a dup of #18764.

@huonw huonw added the A-associated-items Area: Associated items such as associated types and consts. label Nov 21, 2014
@huonw
Copy link
Member

huonw commented Nov 21, 2014

Closing as a dupe of #18764; thanks for filing!

@huonw huonw closed this as completed Nov 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-associated-items Area: Associated items such as associated types and consts.
Projects
None yet
Development

No branches or pull requests

3 participants