Skip to content

Fully qualified path to nested consts complains about ambiguous associated type #53810

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

Open
estebank opened this issue Aug 30, 2018 · 1 comment
Labels
A-associated-items Area: Associated items (types, constants & functions) A-trait-system Area: Trait system A-type-system Area: Type system C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-types Relevant to the types team, which will review and decide on the PR/issue.

Comments

@estebank
Copy link
Contributor

estebank commented Aug 30, 2018

I believe the following code should be accepted by the compiler, but currently complains with error[E0223]: ambiguous associated type:

struct C;

impl C {
    const X: usize = 42;
}

struct S;

impl S {
    const foo: C = C;
}

fn main() {
    let _ = S::foo::X;
}

Might be needed before #26760 (comment) can be done.

@estebank estebank added A-type-system Area: Type system A-trait-system Area: Trait system A-associated-items Area: Associated items (types, constants & functions) labels Aug 30, 2018
@JohnTitor JohnTitor added C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 19, 2019
@jplatte
Copy link
Contributor

jplatte commented Jun 9, 2021

Probably the same root cause as #38078?

@fmease fmease added A-trait-system Area: Trait system T-types Relevant to the types team, which will review and decide on the PR/issue. and removed A-trait-system Area: Trait system labels Dec 21, 2024
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) A-trait-system Area: Trait system A-type-system Area: Type system C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-types Relevant to the types team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants