From: shugo@... Date: 2015-12-18T23:52:46+00:00 Subject: [ruby-core:72370] [Ruby trunk - Bug #11841] [Rejected] StringIO with read and `nil, ''` arguments broken with enabled frozen string literal Issue #11841 has been updated by Shugo Maeda. Status changed from Open to Rejected deepj # wrote: > ~~~ > # frozen_string_literal: true > > io = StringIO.new('') > > io.read(*[nil, '']) > ~~~ The second argument of StringIO#read is a buffer to read, so it shouldn't be frozen. ``` io.read(*[nil, String.new]) ``` ---------------------------------------- Bug #11841: StringIO with read and `nil, ''` arguments broken with enabled frozen string literal https://bugs.ruby-lang.org/issues/11841#change-55661 * Author: deepj # * Status: Rejected * Priority: Normal * Assignee: * ruby -v: ruby 2.3.0dev (2015-12-19 trunk 53195) [x86_64-darwin15] * Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN ---------------------------------------- I'm not sure what behavior is expected here. But the following use case is used in rack (https://github.com/rack/rack/blob/master/test/spec_lint.rb#L496). If frozen string literal is enabled it throws `read': can't modify frozen String (RuntimeError), otherwise nothing. ~~~ # frozen_string_literal: true io = StringIO.new('') io.read(*[nil, '']) ~~~ -- https://bugs.ruby-lang.org/