Skip to content

explicit self and object types (trait types) are incompatible #3865

Closed
@nikomatsakis

Description

@nikomatsakis

This program yields an LLVM error:

trait Foo {
    fn foo(&self) -> uint;
}

impl uint: Foo {
    fn foo(&self) -> uint { *self }
}

fn bar(x: @Foo, v: uint) {
    assert x.foo() == v;
}

fn main() {
    let x: @uint = @3;
    bar(x as @Foo, *x);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generationI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions