Skip to content

<T as Trait>::X::Y fails to parse #22139

Closed
@huonw

Description

@huonw
Member
trait Foo {
    type X;
}
trait Bar {
    type Y;
}

fn foo<T>(_: <T as Foo>::X::Y) 
    where T: Foo,
          T::X: Bar,
{}
<anon>:8:27: 8:29 error: expected one of `+` or `,`, found `::`
<anon>:8 fn foo<T>(_: <T as Foo>::X::Y) 
                                   ^~

Activity

added a commit that references this issue on May 12, 2015

Auto merge of #25171 - quantheory:associated_time_long_paths, r=nikom…

apasel422

apasel422 commented on Jul 28, 2015

@apasel422
Contributor

This now causes the following error, which I think means this issue can be closed:

error: ambiguous associated type; specify the type using the syntax `<<T as Foo>::X as Trait>::Y` [E0223]
steveklabnik

steveklabnik commented on Nov 30, 2016

@steveklabnik
Member

Agreed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-associated-itemsArea: Associated items (types, constants & functions)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @steveklabnik@huonw@apasel422

        Issue actions

          <T as Trait>::X::Y fails to parse · Issue #22139 · rust-lang/rust