Skip to content

Unresolved field with trait with single implementation #17894

@lnicola

Description

@lnicola

We still don't resolve x.

type Alias<T> = T;

trait Trait<T> {
    type Assoc;
}

struct Foo;
struct Bar {
    x: i32,
}

impl Trait<()> for Foo {
    type Assoc = Bar;
}

fn main() {
    Alias::<<Foo as Trait<_>>::Assoc> { x: 10 };
}

Originally posted by @lnicola in #17651 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-tytype system / type inference / traits / method resolutionC-bugCategory: bug

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions