Skip to content

Unified function / method call syntax #6974

Closed
@tj

Description

@tj

I'm not sure how this would play out with internals or if it wouldn't provide enough information to the compiler, but instead of something like:

impl Shape for Circle {
    fn draw(&self, s: Surface) { do_draw_circle(s, *self); }
}

If possible it would be great to just do something like:

fn draw(self: Circle, s: Surface) {
  // ...
}

Where circle.draw(surface) is just sugar for draw(circle, surface).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions