[#81999] [Ruby trunk Bug#13737] "can't modify frozen String" when installing bundled gems — ko1@...
Issue #13737 has been updated by ko1 (Koichi Sasada).
4 messages
2017/07/11
[#82005] [Ruby trunk Bug#13737] "can't modify frozen String" when installing bundled gems — nobu@...
Issue #13737 has been updated by nobu (Nobuyoshi Nakada).
3 messages
2017/07/12
[#82102] Re: register_fstring_tainted:FL_TEST_RAW(str, RSTRING_FSTR) — Eric Wong <normalperson@...>
Koichi Sasada <ko1@atdot.net> wrote:
4 messages
2017/07/18
[#82151] [Ruby trunk Feature#13637] [PATCH] tool/runruby.rb: test with smallest possible machine stack — Rei.Odaira@...
Issue #13637 has been updated by ReiOdaira (Rei Odaira).
3 messages
2017/07/24
[ruby-core:82128] [Ruby trunk Bug#13558] Array#insert does not typecheck the position argument if it's the only argument
From:
nagachika00@...
Date:
2017-07-23 07:30:49 UTC
List:
ruby-core #82128
Issue #13558 has been updated by nagachika (Tomoyuki Chikanaga).
Backport changed from 2.2: WONTFIX, 2.3: DONE, 2.4: REQUIRED to 2.2: WONTFIX, 2.3: DONE, 2.4: DONE
ruby_2_4 r59398 merged revision(s) 58693.
----------------------------------------
Bug #13558: Array#insert does not typecheck the position argument if it's the only argument
https://bugs.ruby-lang.org/issues/13558#change-65885
* Author: kke (Kimmo Lehto)
* Status: Closed
* Priority: Normal
* Assignee:
* Target version:
* ruby -v: ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]
* Backport: 2.2: WONTFIX, 2.3: DONE, 2.4: DONE
----------------------------------------
**rb_ary_insert** does this:
~~~ c
if (argc == 1) return ary;
~~~
For Ruby this means:
~~~ ruby
> [].insert("foo")
=> []
> [].insert(Exception.new)
=> []
~~~
I would expect this to raise a TypeError. The problem here is that if you forget the position argument, because perhaps you thought Array#insert would be an alias for Array#unshift, you get unexpected results and no errors.
If you try to insert two items it fails nicely:
~~~ ruby
> [].insert('foo', 'foo')
TypeError: no implicit conversion of String into Integer
~~~
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>