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

Ambiguous method call in #[godot_api] generated code #858

Open
vby opened this issue Aug 15, 2024 · 1 comment · May be fixed by #1020
Open

Ambiguous method call in #[godot_api] generated code #858

vby opened this issue Aug 15, 2024 · 1 comment · May be fixed by #1020
Labels
bug c: register Register classes, functions and other symbols to GDScript good first issue Good for newcomers

Comments

@vby
Copy link

vby commented Aug 15, 2024

[edit bromeon: Rust codetags]

Here is a minimal reproducible code:

#[derive(GodotClass)]
#[class(base=Sprite2D)]
pub struct Player {
    base: Base<Sprite2D>,
}

#[godot_api]
impl ISprite2D for Player {
    fn init(base: Base<Sprite2D>) -> Self {
        Self { base }
    }

    fn process(&mut self, delta: f64) {}
}

trait TraitA {
    fn process(&mut self, delta: f64);
}

impl TraitA for Player {
    fn process(&mut self, delta: f64) {}
}
error[E0034]: multiple applicable items in scope
  --> src/player.rs:17:8
   |
17 |     fn process(&mut self, delta: f64) {}
   |        ^^^^^^^ multiple `process` found
@Bromeon Bromeon added bug c: register Register classes, functions and other symbols to GDScript labels Aug 15, 2024
@Bromeon
Copy link
Member

Bromeon commented Aug 15, 2024

Good catch, maybe we should explicitly qualify the code-generated virtual call.

Also, you can use ```rs to add syntax highlighting 🙂

@lilizoey lilizoey added the good first issue Good for newcomers label Jan 9, 2025
adalinesimonian added a commit to adalinesimonian/gdext that referenced this issue Jan 20, 2025
@adalinesimonian adalinesimonian linked a pull request Jan 20, 2025 that will close this issue
adalinesimonian added a commit to adalinesimonian/gdext that referenced this issue Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug c: register Register classes, functions and other symbols to GDScript good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants