From: deepjungle.maca@...
Date: 2015-12-21T23:55:26+00:00
Subject: [ruby-core:72424] [Ruby trunk - Bug #11841] StringIO with read and `nil, ''` arguments broken with enabled frozen string literal

Issue #11841 has been updated by deepj #.


Thanks. In fact, I didn't realized the second argument is actually a buffer. My mistake

----------------------------------------
Bug #11841: StringIO with read and `nil, ''` arguments broken with enabled frozen string literal
https://bugs.ruby-lang.org/issues/11841#change-55717

* 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/