From: usa@... Date: 2020-03-30T22:44:18+00:00 Subject: [ruby-core:97638] [Ruby master Bug#16687] Ripper.slice FrozenError in ruby 2.5 Issue #16687 has been updated by usa (Usaku NAKAMURA). Backport changed from 2.5: REQUIRED, 2.6: DONTNEED, 2.7: DONTNEED to 2.5: DONE, 2.6: DONTNEED, 2.7: DONTNEED ruby_2_5 r67871 merged revision(s) 62743. ---------------------------------------- Bug #16687: Ripper.slice FrozenError in ruby 2.5 https://bugs.ruby-lang.org/issues/16687#change-84835 * Author: Dan0042 (Daniel DeLorme) * Status: Closed * Priority: Normal * ruby -v: ruby 2.5.6p201 (2019-08-28 revision 67793) [x86_64-linux] * Backport: 2.5: DONE, 2.6: DONTNEED, 2.7: DONTNEED ---------------------------------------- Trying the example from the Ripper.slice documentation: ```ruby require 'ripper' p Ripper.slice('def m(a) nil end', 'ident') #=> /opt/ruby/2.5/lib/ruby/2.5.0/ripper/lexer.rb:199:in `concat': can't modify frozen String (FrozenError) ``` Just needs to change lexer.rb:195 from `buf = ''` to `buf = +''` -- https://bugs.ruby-lang.org/ Unsubscribe: