mozilla/rust — pull request #4101 by brson (2012-12-03 02:33:13+00:00)
Title: Call default methods on bound typarams more correctly

This makes test cases like the following work:

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

impl int: A { }

fn f(i: T) {
assert i.g() == 10;
}

fn main () {
f(0);
}
```

What doesn't work is if trait A is itself parameterized. This commit includes such testcases, xfailed. As with each of my commits to traits, the hacks involved make me feel uncomfortable. Trans isn't told specifically that it's implementing a default method - instead method lookup on the impl fails so trans decides that must be what's going on then starts grovelling for default implementations.