Skip to content

allow recursive object methods #1432

Closed
Closed
@erickt

Description

@erickt

It's a bit obnoxious when writing an object type that can return instances of itself that we need a tag to break up the recursion:

tag foo_tag = foo;

type foo = obj {
    fn get_children() -> [foo_tag];
};

obj new_foo() {
  fn get_children() -> [foo_tag] { [] }
}

It'd be much nicer if rust would just let us write fn get_children() -> [foo].

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