Skip to content

Segfault when wrapping an anon obj in more than one layer #718

Closed
@lkuper

Description

@lkuper

The call to my_c.foo() in this program segfaults:

fn main() {

    obj a() {
        fn foo() -> int {
            ret 2;
        }
    }

    auto my_a = a();

    auto my_b = obj() {
        with my_a
    };

    assert (my_b.foo() == 2);

    auto my_c = obj() {
        with my_b
    };

    assert (my_c.foo() == 2);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions