Skip to content

Except uses of constructors have no use/def entry in TModel #2189

@toinehartman

Description

@toinehartman

Describe the bug

Except uses of constructors have no use/def entry in TModel.

To Reproduce

void exceptConstructor() {
    println("= Except constructors=");
    tm = typeCheck(
        "syntax S
        '   = foo: \"foo\"
        '   | bar: \"bar\"
        '   | baz: S!foo
        '   ;"
    );

    defs = {d | Define d:<_, "foo", _, _, _, _> <- tm.defines};
    print("Defs of \'foo\': ");
    iprintln(defs);

    // No uses at !except
    print("Uses: ");
    iprintln(invert(tm.useDef)[defs.defined]);

    println("======================");
}

Expected behavior
A use/def entry at the last occurrence of foo.

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions