[MacRuby-devel] [macruby] #65: #sub!, #gsub!, and other bang methods mutate frozen strings

macruby ruby-noreply at macosforge.org
Wed May 28 16:53:02 PDT 2008


#65: #sub!, #gsub!, and other bang methods mutate frozen strings
--------------------------------+-------------------------------------------
 Reporter:  binary42 at gmail.com  |        Owner:  lsansonetti at apple.com
     Type:  defect              |       Status:  closed               
 Priority:  minor               |    Milestone:  MacRuby 0.2          
Component:  MacRuby             |   Resolution:  fixed                
 Keywords:                      |  
--------------------------------+-------------------------------------------
Changes (by lsansonetti at apple.com):

  * status:  reopened => closed
  * resolution:  => fixed
  * milestone:  => MacRuby 0.2

Comment:

 Should be fixed in r234/trunk.

 {{{
 $ ./miniruby -ve 's="foo";s.freeze;s.gsub!(/./,"x");p s'
 MacRuby version 0.2 (ruby 1.9.0 2008-05-17) [universal-darwin9.0]
 -e:1:in `gsub!': can't modify frozen string (RuntimeError)
         from -e:1:in `<main>'
 }}}

-- 
Ticket URL: <http://ruby.macosforge.org/trac/ticket/65#comment:4>
macruby <http://ruby.macosforge.org/>


More information about the MacRuby-devel mailing list