-
Notifications
You must be signed in to change notification settings - Fork 33
Forward-port Bug #21864
#74
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1085,10 +1085,11 @@ def test_args_CALL_1 | |||||||||||||||||||||
| end | ||||||||||||||||||||||
| end | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| OF_NIL_INTO_INTEGER = RUBY_VERSION < "4.1." ? "from nil to integer" : "of nil into Integer" | ||||||||||||||||||||||
|
||||||||||||||||||||||
| OF_NIL_INTO_INTEGER = RUBY_VERSION < "4.1." ? "from nil to integer" : "of nil into Integer" | |
| OF_NIL_INTO_INTEGER = begin | |
| [].fetch(nil) | |
| rescue TypeError => e | |
| if e.message.include?("of nil into Integer") | |
| "of nil into Integer" | |
| else | |
| "from nil to integer" | |
| end | |
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version comparison string "4.1." is malformed - it ends with a period but lacks a patch version. This will cause the string comparison to behave unexpectedly. It should likely be "4.1" (without the trailing dot) or "4.1.0" (with a complete version). String comparison with Ruby versions requires proper formatting to work correctly.