Skip to content

Commit

Permalink
Remove unconditional mutation to super()
Browse files Browse the repository at this point in the history
This mutation only makes sense if the method was called with arguments in the first place.
If there are no arguments `super()` and `super` are semantically equivalent.
And there is no vector towards reduced semantics, which is required for an operator to be valid.

If mutant would be able to emit this mutation conditionally (on the presence of arguments) than this is
a valid operator. Until than we cannot emit it.

[fix #615]
  • Loading branch information
mbj committed Jun 9, 2024
1 parent 830b41c commit d699dab
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
6 changes: 6 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# v0.12.1 2024-06-09

+ [#1445](https://github.com/mbj/mutant/pull/1444)

Remove invalid mutation operator.

# v0.12.1 2024-05-11

* [#1444](https://github.com/mbj/mutant/pull/1444)
Expand Down
1 change: 0 additions & 1 deletion lib/mutant/mutator/node/super.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class Super < self

def dispatch
emit_singletons
emit(N_EMPTY_SUPER)
children.each_index do |index|
mutate_child(index)
delete_child(index)
Expand Down
1 change: 0 additions & 1 deletion meta/super.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
source 'super(foo, bar)'

singleton_mutations
mutation 'super()'
mutation 'super(foo)'
mutation 'super(bar)'
mutation 'super(foo, nil)'
Expand Down

0 comments on commit d699dab

Please sign in to comment.