rust
rust copied to clipboard
cannot have static and instance methods with the same name
This doesn't work:
struct Foo {
baz: uint
}
impl Foo {
static fn bar() {
Foo { baz: 0 }.bar();
}
fn bar() {
}
}
and yields:
error: internal compiler error: calling transform_self_type_for_method on static method
Same error message for:
trait Trait {
static fn bar();
fn foo() {
self.bar();
}
}
There's still some ambivalence over whether this is a bug or a feature (see the comments on the pull request).
I closed the pull request, and would rather fix this by emitting an error.
This is a proper error message now. I'll add the test case along with my pile of other test cases to add. Closing.