Skip to content

"ambiguous associated type" when there's not ambiguity #50905

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
stepancheg opened this issue May 19, 2018 · 1 comment
Closed

"ambiguous associated type" when there's not ambiguity #50905

stepancheg opened this issue May 19, 2018 · 1 comment

Comments

@stepancheg
Copy link
Contributor

trait Bar {
    type Baz;
}

trait Foo {
    type Bar : Bar;
}

fn _qux<F : Foo>(param: F::Bar::Baz) {}


fn main(){
}
error[E0223]: ambiguous associated type
 --> src/main.rs:9:25
  |
9 | fn _qux<F : Foo>(param: F::Bar::Baz) {}
  |                         ^^^^^^^^^^^ ambiguous associated type
  |
  = note: specify the type using the syntax `<<F as Foo>::Bar as Trait>::Baz`

For me it looks like there's no ambiguity here: Foo has only one Bar and Bar has only one Baz.

https://play.rust-lang.org/?gist=347da3f223a841b8ee96ee4a744ba180&version=nightly&mode=debug

@kennytm
Copy link
Member

kennytm commented May 20, 2018

Thanks for the report. This is a duplicate of #38078.

@kennytm kennytm closed this as completed May 20, 2018
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

No branches or pull requests

2 participants