Skip to content

Ruby 2.0 parser doesn't intern symbol strings in literal symbol array#970

Merged
enebo merged 1 commit intojruby:masterfrom
mwarren:qsym_intern_fix
Aug 28, 2013
Merged

Ruby 2.0 parser doesn't intern symbol strings in literal symbol array#970
enebo merged 1 commit intojruby:masterfrom
mwarren:qsym_intern_fix

Conversation

@mwarren
Copy link
Contributor

@mwarren mwarren commented Aug 24, 2013

Symbols created using a literal symbol array don't have the same identities as the same symbols created outside of a literal symbol array:

$ JRUBY_OPTS="--2.0" jirb
2.0.0-p247 :001 > [JRUBY_VERSION, RUBY_VERSION]
 => ["1.7.5.dev", "2.0.0"]
2.0.0-p247 :002 > %i(foo).include?(:foo)
 => false

org.jruby.parser.ParserSupport#asSymbol is not interning. This pull request adds the intern() call.

@mwarren mwarren mentioned this pull request Aug 24, 2013
enebo added a commit that referenced this pull request Aug 28, 2013
Ruby 2.0 parser doesn't intern symbol strings in literal symbol array
@enebo enebo merged commit a0e1040 into jruby:master Aug 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants