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

"associated type T not found for type parameter X" error with where clause #20745

Closed
mandel59 opened this issue Jan 8, 2015 · 1 comment
Closed

Comments

@mandel59
Copy link

mandel59 commented Jan 8, 2015

trait A {
    type T;
}

impl A for () {
    type T = i32;
}

fn foo<X>(_x: X::T) where X: A {
}

fn main() {
    foo::<()>(42);
}

This fails to compile with:

assoc.rs:9:15: 9:19 error: associated type `T` not found for type parameter `X`
assoc.rs:9 fn foo<X>(_x: X::T) where X: A {
                         ^~~~
error: aborting due to previous error

It passes with tweaking the definition:

fn foo<X: A>(_x: X::T) {
}
@mandel59
Copy link
Author

mandel59 commented Jan 8, 2015

a dup of #20300

@mandel59 mandel59 closed this as completed Jan 8, 2015
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

1 participant