Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

case doesn't match empty array #3558

Closed
rcrogers opened this issue Dec 21, 2015 · 3 comments
Closed

case doesn't match empty array #3558

rcrogers opened this issue Dec 21, 2015 · 3 comments
Milestone

Comments

@rcrogers
Copy link

@rcrogers rcrogers commented Dec 21, 2015

jruby-9.0.0.0.pre1 :014 > a = []; case a; when a; true; else 'BROKEN'; end
 => "BROKEN"

Strangely, case equality works as expected:

jruby-9.0.0.0.pre1 :019 > a = []; a === a
 => true 
@subbuss
Copy link
Contributor

@subbuss subbuss commented Dec 21, 2015

Please use a newer version (9.0.4.0 is the latest release). In any case, this is not a problem on master. See below.

[subbu@earth ir] jruby --version
jruby 9.0.5.0-SNAPSHOT (2.2.3) 2015-12-21 aa2f5d6 Java HotSpot(TM) 64-Bit Server VM 24.80-b11 on 1.7.0_80-b15 +jit [linux-amd64]
[subbu@earth ir] jruby -S irb
Ignoring jruby-launcher-1.1.0-java because its extensions are not built.  Try: gem pristine jruby-launcher --version 1.1.0
Ignoring ruby-debug-ide-0.4.23.beta1 because its extensions are not built.  Try: gem pristine ruby-debug-ide --version 0.4.23.beta1
irb(main):001:0> case []; when []; true; else 'BROKEN'; end
=> true
irb(main):002:0>
@subbuss subbuss closed this Dec 21, 2015
@rcrogers
Copy link
Author

@rcrogers rcrogers commented Dec 21, 2015

Oops, thanks. RVM lied to me about what jruby versions were available.

@rcrogers
Copy link
Author

@rcrogers rcrogers commented Dec 21, 2015

For anyone else reading, this is still broken on 9.0.4.0:

jruby-9.0.4.0 :001 > a = []; case a; when a; true; else 'BROKEN'; end
 => "BROKEN"
@subbuss subbuss added this to the JRuby 9.0.5.0 milestone Dec 22, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants