Skip to content

Self doesn't work in struct expression position #10

@uberFoo

Description

@uberFoo

Here's a failing example:

struct Counter {
    count: int,
}

impl Counter {
    fn new() -> Self {
        Self { count: 0 }
    }

    fn increment(self) {
        self.count = self.count + 1;
    }

    fn get(self) -> int {
        self.count
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions