Closed
Description
Not sure what is going on here. Maybe the check for static-ness agreement should fail compilation first?
Error
[burg@burg-macchiato Desktop]# rustc test.rs
test.rs:10:4: 10:51 error: method `woops`'s self type does not match the trait method's self type
test.rs:10 static fn woops(&const self) -> ~str { ~"foo" }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: internal compiler error: calling transform_self_type_for_method on static method
Test case
struct Bike {
name: ~str,
}
trait BikeMethods {
fn woops(&const self) -> ~str;
}
pub impl Bike : BikeMethods {
static fn woops(&const self) -> ~str { ~"foo" }
}
pub fn main() {
let b = Bike { name: ~"schwinn" };
b.woops();
}