Skip to content

Integrate projection types into method dispatch #20469

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
nikomatsakis opened this issue Jan 3, 2015 · 1 comment · Fixed by #20665
Closed

Integrate projection types into method dispatch #20469

nikomatsakis opened this issue Jan 3, 2015 · 1 comment · Fixed by #20665
Assignees
Labels
A-associated-items Area: Associated items (types, constants & functions)
Milestone

Comments

@nikomatsakis
Copy link
Contributor

Currently you must use UFCS form to invoke methods. Here is an example by @kinghajj:

#![feature(associated_types)]

trait Foo {
  fn foo(&self) -> ();
}

trait Bar {
  type F: Foo;
}

struct Wat<B: Bar> {
  fs: Vec<B::F>,
}

impl<B: Bar> Wat<B> {
  fn wat(&mut self) -> () {
    self.fs.pop().unwrap().foo();
  }
}

fn main() {
}
@nikomatsakis nikomatsakis self-assigned this Jan 3, 2015
@nikomatsakis nikomatsakis added this to the 1.0 alpha milestone Jan 6, 2015
@nikomatsakis
Copy link
Contributor Author

Putting on alpha milestone, though I think this ultimately rates as a "nice to have". But it's really surprising that it doesn't work. Got a patch underway.

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 (types, constants & functions)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant