Skip to content

Resolving virtual methods with generic arguments does not work. #152

@JustusAdam

Description

@JustusAdam

Setup:

#[paralegal::marker(sink, arguments = [0])]
fn actual_sink<T>(t: T) {}

#[paralegal::analyze]
fn main<S: Snk>(s: &S) {
    s.sink(0)
}

When the trait Snk is defined with a method that does not take a generic parameter then calling Instance::resolve returns a Virtual instance.

trait Snk {
    fn sink(&self, t: usize) {
        actual_sink(t)
    }
}

However if the argument is generic, instance resolution fails.

trait Snk {
    fn sink<T>(&self, t: T) {
        actual_sink(t)
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions