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

Cross-crate default methods don't work #4103

Closed
brson opened this issue Dec 3, 2012 · 4 comments
Closed

Cross-crate default methods don't work #4103

brson opened this issue Dec 3, 2012 · 4 comments
Labels
A-traits Area: Trait system

Comments

@brson
Copy link
Contributor

brson commented Dec 3, 2012

This assumes #4101 is merged. ICE's.

trait_default_method_xc_aux.rs:

pub trait A {
    fn g() -> int { 10 }
}

impl int: A { }

trait-default-method-xc.rs

// aux-build:trait_default_method_bound_aux.rs

extern mod aux(name = "trait_default_method_bound_aux");

fn f<T: aux::A>(i: T) {
    assert i.g() == 10;
}

fn main () {
    f(0);
}
@ghost ghost assigned catamorphism Feb 21, 2013
@bstrie
Copy link
Contributor

bstrie commented May 6, 2013

Right now compiling the first file fails with error: default methods are experimental. We'll have to try reproducing once default methods are actually enabled.

@jdm
Copy link
Contributor

jdm commented May 7, 2013

You can build with -A default-methods to avoid the error.

@msullivan
Copy link
Contributor

Cross crate default methods don't seem to work... ever. Trying to directly invoke a cross crate default method fails in typechecking.

@msullivan
Copy link
Contributor

Marking that this is part of #2794 for tracking purposes.

bors added a commit that referenced this issue Jun 21, 2013
This fixes the large number of problems that prevented cross crate
methods from ever working. It also fixes a couple lingering bugs with
polymorphic default methods and cleans up some of the code paths.

Closes #4102. Closes #4103.

r? nikomatsakis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-traits Area: Trait system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants