Closed
Description
I think it would be great if this sort of thing worked:
trait Shizzle {
static fn shizzle();
}
trait Shozzle : Shizzle {
static fn shizzle() {
io::println(~"shizzle! " + shozzle::<self>());
}
static fn shozzle() -> ~str;
}
impl int : Shozzle {
static fn shozzle() -> ~str { ~"i'm an int!" }
}
fn main() {
shizzle::<int>();
}
Currently it fails with this error:
test-trait-inheritance.rs:12:4: 12:23 error: duplicate definition of value shizzle
test-trait-inheritance.rs:12 static fn shizzle() {
^~~~~~~~~~~~~~~~~~~
test-trait-inheritance.rs:5:4: 5:23 note: first definition of value shizzle here:
test-trait-inheritance.rs:5 static fn shizzle();
^~~~~~~~~~~~~~~~~~~
error: aborting due to previous error
Metadata
Metadata
Assignees
Labels
No labels