Skip to content

ICE when calling method on trait object with incorrect self type #5153

Closed
@jdm

Description

@jdm
trait Foo {
    fn foo(~self);
}

impl Foo for int {
    fn foo(~self) {
    }
}

fn main() {
    (@5 as @Foo).foo();
}

error: internal compiler error: ~self receiver with non-~Trait

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-trait-systemArea: Trait systemE-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions