How to avoid mutation did not compile when the variable is a struct type?
xjtuhorse opened this issue · 0 comments
xjtuhorse commented
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.