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

Allow trait methods to be called outside of generics #757

Closed
cburgdorf opened this issue Jun 29, 2022 · 0 comments
Closed

Allow trait methods to be called outside of generics #757

cburgdorf opened this issue Jun 29, 2022 · 0 comments

Comments

@cburgdorf
Copy link
Collaborator

What is wrong?

Currently traits are only useful when used with generics. But it should also be possible to use them like this:

pub struct Bar {}

impl SomeTrait for Bar {
  fn foo(&self) {
    ...
  }
}

trait SomeTrait {
    fn foo(&self);
}


...

    let bar: Bar = Bar();
    bar.foo();

How can it be fixed

🔪

cburgdorf added a commit to cburgdorf/fe that referenced this issue Jul 7, 2022
cburgdorf added a commit to cburgdorf/fe that referenced this issue Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant