Skip to content

[SUGGESTION] Static members in types #522

Closed as not planned
Closed as not planned
@MaxSagebaum

Description

@MaxSagebaum

This is more of a question.

static members are currently not supported in cpp2. Is this due to the lack of time or some other considerations?

I would try to implement it as another modifier like e.g. public so that

t : type = {
 public static foo: int = 0;
}

main: () -> int = {
 t::foo += 1;
}

should work. I think t.foo += 1; would be better but this would be a quite large syntactic change in contrast to cpp1.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions