Skip to content

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

Closed

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);
}

Activity

  1. nikomatsakis commented on Dec 4, 2012

    @nikomatsakis
    ContributorAuthor

    Fixed.

  2. added a commit that references this issue on Sep 8, 2024
  3. added 2 commits that reference this issue on Aug 21, 2026
    236ac63
    c859a64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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