Skip to content

How to avoid mutation did not compile when the variable is a struct type? #96

Description

@xjtuhorse

Mutation did not compile
@@ -1122,7 +1122,7 @@
-- enqueue(&e.heapLoc)
++ _, _ = enqueue, e.heapLoc{}
Exited with 2

Mutation did not compile
@@ -620,8 +620,7 @@
-- #e.stmts(n.Ninit)
++ _, _ = e.stmts, n.Ninit{}
Exited with 2

In the preceding example, heapLoc and Ninit are variables of the struct type. If the variables are used as structs, the compilation fails after mutation. The type of this variable should be correctly identified so that it can be compiled and executed. In the above mutated code, {} is unnecessary.

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