Skip to content

Fixes #7854. Pattern matching with an empty hash should not match#7858

Merged
enebo merged 4 commits intojruby:masterfrom
enebo:fix_7854
Jul 18, 2023
Merged

Fixes #7854. Pattern matching with an empty hash should not match#7858
enebo merged 4 commits intojruby:masterfrom
enebo:fix_7854

Conversation

@enebo
Copy link
Member

@enebo enebo commented Jul 14, 2023

This had two problems first was IR build was not realizing the empty hash was actually empty. {} is still put into the AST so we had to check that no elements are within that.

Second problem was missing logic to change the pattern error string to 'is not empty'. This was a lesser issue since it still returns a proper error but we may as well match the strings.

This had two problems first was IR build was not realizing the
empty hash was actually empty.  {} is still put into the AST
so we had to check that no elements are within that.

Second problem was missing logic to change the pattern error
string to 'is not empty'.  This was a lesser issue since it
still returns a proper error but we may as well match the
strings.
@enebo enebo added this to the JRuby 9.4.4.0 milestone Jul 14, 2023
enebo added 3 commits July 17, 2023 14:39
```in **``` appeared the same as ```=> {}``` in a single
pattern match.  MRI in parser is doing something I do not
comprehend with 0 vs none().  I decided to just make ```**```
explicit for kwrests in pattern matching.  We already have
an interned object for the concept so I just used that.
@enebo enebo merged commit 73d3c1e into jruby:master Jul 18, 2023
@enebo enebo deleted the fix_7854 branch March 4, 2025 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant