From: daniel@...42.com Date: 2020-03-11T13:27:47+00:00 Subject: [ruby-core:97447] [Ruby master Bug#16687] Ripper.slice FrozenError in ruby 2.5 Issue #16687 has been reported by Dan0042 (Daniel DeLorme). ---------------------------------------- Bug #16687: Ripper.slice FrozenError in ruby 2.5 https://bugs.ruby-lang.org/issues/16687 * Author: Dan0042 (Daniel DeLorme) * Status: Open * Priority: Normal * ruby -v: ruby 2.5.6p201 (2019-08-28 revision 67793) [x86_64-linux] * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN ---------------------------------------- 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: