Skip to content

Using Self reference does not yield correct goto/find references results #658

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
Arcticae opened this issue May 19, 2025 · 0 comments · May be fixed by #717
Open

Using Self reference does not yield correct goto/find references results #658

Arcticae opened this issue May 19, 2025 · 0 comments · May be fixed by #717
Assignees

Comments

@Arcticae
Copy link
Member

Problem

Given the example:

mod nested {
    pub trait Other {
        const ABC: felt252;
    }
    pub mod nested {
        use super::Other;

        pub impl OtherImpl of Other {
            const ABC: felt252 = 123;
        }
    }
}


trait Trait {
    const C: u8;
    impl A: nested::Other;
    type T;
    fn f();

}

impl TraitImpl of Trait {
    type T = u8;

    const C: u8 = 5;

    impl A = nested::nested::OtherImpl;

    fn f() {
        let _x: Self::T = Self::C;
        Self::A::ABC;
    }
}

Using gotos, and find references on T/C/A usages and definitions does not yield expected results (it resolves the types directly instead of going to trait definition). This should be fixed in a similar manner that ExprPaths references are handled for impls (done in #640)

Steps

No response

Possible Solution(s)

No response

Notes

No response

Scarb Version


@Arcticae Arcticae changed the title Using Self resolves the trait Using Self reference does not yield correct goto/find references results May 19, 2025
@Arcticae Arcticae self-assigned this May 19, 2025
@Arcticae Arcticae moved this from Triage to Todo in Cairo Language Services May 19, 2025
@Arcticae Arcticae moved this from Todo to In Progress in Cairo Language Services May 26, 2025
@piotmag769 piotmag769 moved this from In Progress to Todo in Cairo Language Services May 26, 2025
@piotmag769 piotmag769 moved this from Todo to In Progress in Cairo Language Services Jun 2, 2025
@Arcticae Arcticae linked a pull request Jun 3, 2025 that will close this issue
@Arcticae Arcticae linked a pull request Jun 3, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging a pull request may close this issue.

1 participant