heckle icon indicating copy to clipboard operation
heckle copied to clipboard

Block that always causes a syntax error

Open mockdeep opened this issue 12 years ago • 1 comments

I've come across a block of code I can't heckle because it always causes a syntax error. Style issues aside, here's the block:

 def my_awesome_method
   begin
     if true
       puts "cool"
     end
     {}.delete(:whatever)
   rescue 
     puts "weird"
   end
 end

Heckle tries to replace the block as such:

--- original
+++ mutation
 def my_awesome_method
   begin
     (puts("cool") if true
-    {  }.delete(:whatever)) rescue puts("weird")
+    # do nothing) rescue puts("weird")
   end
 end

Not sure if this is an issue directly with heckle or one of the libraries it uses, e.g. ParseTree.

mockdeep avatar Sep 27 '11 21:09 mockdeep