Project

General

Profile

Actions

Bug #9202

closed

Array#uniq freezes duplicate strings

Added by drbrain (Eric Hodel) about 11 years ago. Updated about 11 years ago.

Status:
Closed
Target version:
ruby -v:
ruby 2.1.0dev (2013-12-02 trunk 43958) [x86_64-darwin13.0]
[ruby-core:58809]

Description

I imagine this is related to the recent frozen string changes. This behavior change in Array#uniq breaks RubyGems:

$ cat test.rb
p unique: %w[a].uniq.any? { |item| item.frozen? }
p duplicate: %w[a a].uniq.any? { |item| item.frozen? }
$ ruby -v test.rb
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-darwin12.4.0]
{:unique=>false}
{:duplicate=>false}
$ make runruby
./miniruby -I../trunk/lib -I. -I.ext/common ../trunk/tool/runruby.rb --extout=.ext -- --disable-gems ../trunk/test.rb
{:unique=>false}
{:duplicate=>true}


Files

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0