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

cannot have static and instance methods with the same name #4265

Closed
ttaubert opened this issue Dec 23, 2012 · 4 comments
Closed

cannot have static and instance methods with the same name #4265

ttaubert opened this issue Dec 23, 2012 · 4 comments
Labels
A-typesystem Area: The type system
Milestone

Comments

@ttaubert
Copy link
Contributor

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
@ttaubert
Copy link
Contributor Author

Same error message for:

trait Trait {
  static fn bar();

  fn foo() {
    self.bar();
  }
}

@catamorphism
Copy link
Contributor

There's still some ambivalence over whether this is a bug or a feature (see the comments on the pull request).

@brson
Copy link
Contributor

brson commented Jan 14, 2013

I closed the pull request, and would rather fix this by emitting an error.

@catamorphism
Copy link
Contributor

This is a proper error message now. I'll add the test case along with my pile of other test cases to add. Closing.

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

No branches or pull requests

3 participants